vba code to save

SunWuKung

Registered User.
Local time
Today, 04:14
Joined
Jun 21, 2001
Messages
172
A slightly different aspect of the previous topic: people always suggested to use the
DoCmd.RunCommand acCmdSaveRecord
to force saving the current record on the form. For me it always gives the error message:
The command or action "SaveRecord" isn't available now.
I think it is because I got rid of the menu and tool bars. Is there an other way to do this?
Right now I am using Goto previous, Goto next - but there must be a nicer way.
Many thanks.
SWK

[This message has been edited by SunWuKung (edited 08-28-2001).]
 
The docmd.save command should work out for you. Hope this helps.

Doug
 
The DoCmd.Save command saves the FORM not the record. It will not do what you want.

Where are you putting the saverecord command? Getting rid of the manu and tool bars should not be causing the problem.
 
use this

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

willem
 
I'm in total agreement with Pat ......

DoCmd.RunCommand acCmdSaveRecord

This should be the ticket ... unless you have some other code that conflicts or another form open that is bound to the same table.

HTH
RDH

[This message has been edited by R. Hicks (edited 08-30-2001).]
 
Thank you for all your help. The solution was indeed to replace my command button from my subform to the parent form - since I wanted to save the parent form's record befor doing things with the subform. It works now with DoCmd.RunCommand acCmdSaveRecord. Thanks again.
SWK

[This message has been edited by SunWuKung (edited 08-30-2001).]

[This message has been edited by SunWuKung (edited 08-30-2001).]
 

Users who are viewing this thread

Back
Top Bottom