Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form/Subform Events

Status
Not open for further replies.

Hmadyson

Programmer
Mar 14, 2001
202
US
Here is the setup:

I have a form with a tab control. On one of the pages of the tab control I have a subform. To edit the subform, you have to press edit which will activate all of the controls on the subform, and they can be edited. When you are done editing you must hit okay, which will validate all of the data and save it.

Problem:

If you are in edit mode on the subform, and then click to another page in the tab control, all of your data changes are lost on the subform if you haven't hit ok on the subform. I am trying to trap the event when they click off the subform and onto another page to either give a message that changes were lost, or to go back to the subform. When I program the subform's exit event, it is too late, all of the changes are already gone. I don't think that I want to program every single deactivate event on the subform, since I only care if the new control is on the form instead.

Please help. Thank you in advance.
 
You may try the "Beforeupdate" event of the subform.

It kinds of surprises me that the changes in the subform were lost. I expect that the changes in the subform have been saved after you click another page tab of the main form.

Seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top