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!

How can I have my own custom save button in my form

Status
Not open for further replies.

robbob

Programmer
Oct 28, 2000
5
AU
Hi

I'm wondering if there is anyway to have my own custom save button on my forms instead of using Access's record selectors to save a newly added record, or edits to a record. The same goes for having an Add, Cancel and Delete button.

I have tried to do this using DoCmd MenuItem actions, but have found, when I capture "Write Conflicts" and set the response to acDataErrContinue, that I get a Runtime Error 2051, saying that, the DoCmdMeniItem was cancelled. I think this is because, the write conflict exception was thrown by the DoCmd.DoMenuItem SaveRecord action, and after I've caught the write conflict in the Forms OnError, displayed my own message box, and set the OnError Response to acDataErrContinue, that Access knows that the DoCmd was stopped abnormally.

N.B

I am using Access 97 presently.
 
I normally use:

Code:
docmd.close acform,"formname",acsaveyes

and

Code:
docmd.close acform,"formname",acsaveno

respectively for saving/close and cancel/close..

Hope this helps..


Phooey
Andrew.j.harrison@capgemini.co.uk
Otherwise known as Windy Bottom.
 
try using:

DoCmd.RunCommand acCmdSaveRecord

Mike Rohde
rohdem@marshallengines.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top