469,609 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

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

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
1 5373
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.

Similar topics

1 post views Thread by swingingming | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.