Using objects Help!!

chrisguk

Registered User.
Local time
Yesterday, 23:41
Joined
Mar 9, 2011
Messages
148
Hi,

I understand that you can using "Me." to declare that the item you are referring to is in that form.

I want to create some generic buttons on all my forms for example Save, Close Form and search.

The normal format of closing a form would be:

Code:
DoCmd.Close acForm, "frmsites", acSaveNo

How do I change that to say close the present form using "Me"
 
I would suggest a totally revolutionary approach, missed by many, but you have been selected to be let in on the secret:

Look at what documentation has to say about the arguments of DoCmd.Close.
 
I would suggest a totally revolutionary approach, missed by many, but you have been selected to be let in on the secret:

Look at what documentation has to say about the arguments of DoCmd.Close.

For some reason I thought it would be a more difficult answer than the obvious. Just wanted confirmation really.

I now understand that if I want to save the record prior to close then I use:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
 
I now understand that if I want to save the record prior to close then I use:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close

Not really. The record is saved if you move to another record or take focus away from the active form in which the record is. This is the way of Access, so your record-saving line is redundant. You'd have to do some coding to avoid a save.
 
I now understand that if I want to save the record prior to close then I use:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
Doesn't the record get saved automatically when you close?
 

Users who are viewing this thread

Back
Top Bottom