OnChange Event and Debug

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a subform. The "Vendor" on the subform defaults to the
"Vendor" on the Main form (Vendor default = Parent!Vendor). The "Vendor" on
the subform is a combo box.
The OnChange event of the subform.Vendor calls a Macro that has two
conditional statements that should either set a value of "3" in the
subform.status when the subform.Vendor <> the Parent!Vendor, or set the
subform.status to a value of "1" if the subform.Vendor = Parent!Vendor.
When the form comes up the subform.vendor is defaulted correctly to match
the "Vendor" on the main form. Upon selecting a different Vendor from the
subform.vendor combo box, the macro runs and sets the correct value of 3 in
the subform.status control. If I change the subform.vendor combobox back to
the original Vendor that matches the Main form, it does not change the
subform.status to a 1. Single stepping the macro shows that it is evaluating
the condition as "false" even though the form is showing that the Vendor in
both the Main and subform are a match.
I have never used debug before, but tried that to get the value of the
OnChange control, but I do not have an example for a main and subform and
cannot get the syntax correct.
Any ideas why this is evaluating to false when the Vendor control is changed
a second time?
 
I did find an error in my conditional statement that was causing this to
evaluate to false.
However, for the future if anyone could help me with the syntax required by
Debug to look at a control on a subform it would be most helpful.
 
Back
Top