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!

Cancel/Undo button

Status
Not open for further replies.

richardii

Programmer
Jan 8, 2001
104
GB
I would like to add a button that Cancels (undos) changes to a form/subform. I add the button to the main form using the wizard. It works fine for changes to the form, but will not work when I make changes to the subform.

Is there any way I can do this without actually adding a button to the subform?
 
You'd have to direct the action to the subform... try adding this line before anything else in the On Click event:
Forms![TheNameOfYourMainForm]![TheNameOfYourSubFormAsSeenByTheMainForm].Setfocus
Gord
ghubbell@total.net
 
you could also have referential integrity set on the table/subtable relationship (with cascade adds & deletes). that way access will do the work of deleting the subtable records for you when you delete the top level table record.

but this is only going to work if the tables are linked many to one. if not, then use Gord's approach.

Please note that many-to-one relationship doesn't mean that you have to have many records to one record here, it's just a way of setting up dominant/subordinate record relationships between tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top