C
Cory
Using Access 2007 on Vista Home Premium.
I have a procedure called Build_Form, which creates a new form at runtime
and populates it with a tab control. The tab control has multiple pages and
each page has some labels and combo boxes. My goal is to get the value of the
combo box before and after it is updated by the user so that I can find and
update a record(s) in a table.
I have set the BeforeUpdate and AfterUpdate events for all of the combo
boxes to run custom functions as follows:
cmbTemp.BeforeUpdate="=Combo_BeforeUpdate()"
cmbTemp.AfterUpdate="=Combo_AfterUpdate()"
Since the Events will be running outside of the actual form, I can't use
something simple like Me.cmbComboName.Value to get the value from the combo
box. The only way that I've come up with to get the values is to go through
each combo box on the form and put their values and names into an array both
before and after update then compare to see what changed. Does anyone have a
more elegant solution?
Before someone suggests that I create a form in design mode, save it, and
then simply change the visible property of controls as they are needed at
runtime, I have chosen to do it this way for good reason. Let's just assume
that designing and saving a form isn't an option.
Thanks in advance for any help.
-Cory
I have a procedure called Build_Form, which creates a new form at runtime
and populates it with a tab control. The tab control has multiple pages and
each page has some labels and combo boxes. My goal is to get the value of the
combo box before and after it is updated by the user so that I can find and
update a record(s) in a table.
I have set the BeforeUpdate and AfterUpdate events for all of the combo
boxes to run custom functions as follows:
cmbTemp.BeforeUpdate="=Combo_BeforeUpdate()"
cmbTemp.AfterUpdate="=Combo_AfterUpdate()"
Since the Events will be running outside of the actual form, I can't use
something simple like Me.cmbComboName.Value to get the value from the combo
box. The only way that I've come up with to get the values is to go through
each combo box on the form and put their values and names into an array both
before and after update then compare to see what changed. Does anyone have a
more elegant solution?
Before someone suggests that I create a form in design mode, save it, and
then simply change the visible property of controls as they are needed at
runtime, I have chosen to do it this way for good reason. Let's just assume
that designing and saving a form isn't an option.
Thanks in advance for any help.
-Cory