P
Paul Ponzelli
I've run into difficulty when I'm trying to run VBA code from a click event
in the main form while a record in a subform is still in edit mode. That
is, sometimes a user will enter a record in a subform and click a command
button in a main form before they have saved the record they're adding in
the subform.
If the code depends on the data in that record that's in edit mode, it won't
be able to run properly since the new data being entered by the user hasn't
been saved into the table.
For example, in one case the click event runs a report that depends on data
in the subform. In this case, I'd like the code in the click event to save
that record in the subform before opening the report, so the report will
show the new record.
I realize I could hide the Report button until the user clicks a Save Record
button, but that seems like it might be adding an unnecessary step in what
must be a very common occurrence - where a user tries to execute a command
before saving the current record. Can anyone tell me the best way to handle
this situation?
Thanks in advance,
Paul
in the main form while a record in a subform is still in edit mode. That
is, sometimes a user will enter a record in a subform and click a command
button in a main form before they have saved the record they're adding in
the subform.
If the code depends on the data in that record that's in edit mode, it won't
be able to run properly since the new data being entered by the user hasn't
been saved into the table.
For example, in one case the click event runs a report that depends on data
in the subform. In this case, I'd like the code in the click event to save
that record in the subform before opening the report, so the report will
show the new record.
I realize I could hide the Report button until the user clicks a Save Record
button, but that seems like it might be adding an unnecessary step in what
must be a very common occurrence - where a user tries to execute a command
before saving the current record. Can anyone tell me the best way to handle
this situation?
Thanks in advance,
Paul