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!

Saving records in bound forms without using DoCmd

Status
Not open for further replies.

robbob

Programmer
Oct 28, 2000
5
AU
Hi

I am wondering if anyone knows of a method of saving a record in a bound form, using a custom button, instead of Access's record selectors, or menu items.

I have tried it using DoCmd.RunCommand acCmdSaveRecord, however, I run into problems with this approach, when the save record generates an error, i.e Write Conflict, and Access repsonds with an awful messagebox about Runtime error 2501 - The DoCmd.RunCommand was cancelled.

I am using Access 97 currently. I tried using the methods AddNew/Edit and Update/CancelUpdate of the Forms Recordset clone but was unsuccesful.

I was thinking I may have to write my own unbound form logic to use instead of bound forms.

I hope someone can help.

Thanks

Rob
 
Use the 'Refresh' and 'Requery' methods of the form. You might have to do a bit of messing about to ensure you get back to the same record especially if the DataEntry property of the form is set to true. But just keep a note of the record you were on and revert to it after the requery is done. Durkin
alandurkin@bigpond.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top