By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

saving a record before a Close action -- "Me.Dirty = False" OR "RunCommand acCmdSaveRecord"

P: n/a
RC
If I want to explicitly save the record before executing a Close
action. Which of the following should I use? Or does it depend on
whether it is based on a Form or something else?

If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.Close

or

If Me.Dirty Then
Me.Dirty = False
End If
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The RunCommand works only if the from has focus.

Setting the Dirty property is better: you can specify the form, and it works
whether it has focus or not.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"RC" <rc*********@yahoo.com> wrote in message
news:3c************************@posting.google.com ...
If I want to explicitly save the record before executing a Close
action. Which of the following should I use? Or does it depend on
whether it is based on a Form or something else?

If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.Close

or

If Me.Dirty Then
Me.Dirty = False
End If

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.