K
Kenny
Hello All,
Here is what I am trying to do:
I have two tables (table A and table B) with related
fields. Each table is represented by it's own form (form A
and form B) -- neither is a subform to the other and all
controls on the forms are bound to their respective
table/fields. On form A there is a command button that,
when clicked, will open form B and display the related
record if it exists. So far so good. When a related
record doesn't exist in table B I want to pre-fill some of
the controls on form B with values from some of the
controls on form A to facilitate data entry on form B.
Currently I am assigning the values in the controls on
form A to module-level public variables. When I attempt
to assign the values of variables to the controls on form
B in the Form_Open procedure I get the "You can't assign a
value to this object" error message during execution.
However, if I create a command button on form B and
duplicate the assignments code it works just fine. At
first I thought it had something to do with the controls
being bound, but then why would it allow me to make the
assignments through the command button?
So is there any way I can assign the bound controls on
form B to the values of the global variables during the
Form_Open procedure?
Thanks,
Kenny
Here is what I am trying to do:
I have two tables (table A and table B) with related
fields. Each table is represented by it's own form (form A
and form B) -- neither is a subform to the other and all
controls on the forms are bound to their respective
table/fields. On form A there is a command button that,
when clicked, will open form B and display the related
record if it exists. So far so good. When a related
record doesn't exist in table B I want to pre-fill some of
the controls on form B with values from some of the
controls on form A to facilitate data entry on form B.
Currently I am assigning the values in the controls on
form A to module-level public variables. When I attempt
to assign the values of variables to the controls on form
B in the Form_Open procedure I get the "You can't assign a
value to this object" error message during execution.
However, if I create a command button on form B and
duplicate the assignments code it works just fine. At
first I thought it had something to do with the controls
being bound, but then why would it allow me to make the
assignments through the command button?
So is there any way I can assign the bound controls on
form B to the values of the global variables during the
Form_Open procedure?
Thanks,
Kenny