Save and go to new

jbphoenix

Registered User.
Local time
Today, 07:46
Joined
Jan 25, 2007
Messages
98
How do I code a cmdbtn to save the current record and then go to a new blank form?

The form opens with all fields being blank except the field for today's date and order_time, which is fine. The user fills out the form and then I would like them to click a btn that will save the record and then take them back to a blank form so they may enter another order.

Thanks for any help.
 
create a button and put this in its onclick
Code:
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNewRec
 
create a button and put this in its onclick
Code:
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNewRec

No, no, no, no! Ray - did I get through on that one.

Don't use DoMenuItem code. It can cause major trouble between versions.

Use Docmd.RunCommand acCmdSaveRecord instead.

Stay away from DoMenuItem code as it has been deprecated by Microsoft and is only in there as an aid to be backwards compatible. The correct way is to use the DoCmd.RunCommand acCmdxxx commands as they will do almost everything that the menu has.
 
SHITAKI!!!!!!!!

all i did was use the button wizard and copy the code in that.
my bad

Glad you are here to clean up my mistakes
 
Microsoft is horrible about that. They use outdated code in their wizards, so it makes it LOOK like it's okay. It's one of my pet peeves about them.
 
Like ive seen many others say
i know enough to be dangerous and thats all

believe me... i have MANY MANY Peeves about microsoft.

did u get my message about the embedded pic?
 

Users who are viewing this thread

Back
Top Bottom