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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save a record on Form before leaving record 2

Status
Not open for further replies.

asjohnson

Technical User
Mar 8, 2001
15
0
0
US
Hi all, this is probably simple, but what I want to do is save the current record on a form before the user leaves the current record. Somthing like a Save button. I realize that the record is saved once a new record is opened, but I want to save prior to that. Any ideas???
 
Hi asjohnson,
Place your form in design view and make sure the button on the toolbar with thw wand and stars is depressed. Click on command button and kind of drag it to shape on your form. Follow the wizards instructions et voila! a save record button. Gord
ghubbell@total.net
 
Thanks ghubbell, that was quick and easy. Do you know how to program the same task using DAO?
 
Do you mean using VBA? DAO is for manipulating database objects, not data in the tables.

In VBA you would code:
DoCmd.RunCommand acCmdSaveRecord Rick Sprague
 
I'm sorry, that wasn't quite right. DAO is also for manipulating data in tables--but only if you have access to the Recordset. The data on a form is read using the form's own Recordset, which you can't get to in Access 97, so you can't use DAO to save it yourself. You have to get Access to do it for you, and that's what RunCommand acCmdSaveRecord does. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top