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

Docmd.save Does Not Produce Error

P: n/a
WJA
I'm probably missing something here but I can't understand the
following. When 2 users try to save a record with the same primary key
(a number field), the first record saves as expected, but the second
does not produce an error. The "Save" button uses "Docmd.Save" to save
the record. If I insert "Me.Dirty = False" before "Docmd.Save" an
error is produced. Why doesn't "Docmd.Save" produce an error but
instead silently fails to save the record?

Any help appreciated.

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
DoCmd.Save does not save the record.
It saves any design changes to the form.

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

"WJA" <WJ****@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm probably missing something here but I can't understand the
following. When 2 users try to save a record with the same primary key
(a number field), the first record saves as expected, but the second
does not produce an error. The "Save" button uses "Docmd.Save" to save
the record. If I insert "Me.Dirty = False" before "Docmd.Save" an
error is produced. Why doesn't "Docmd.Save" produce an error but
instead silently fails to save the record?

Nov 13 '05 #2

P: n/a
Try:
DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD
instead of your expression.
-Ed

"WJA" <WJ****@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm probably missing something here but I can't understand the
following. When 2 users try to save a record with the same primary key
(a number field), the first record saves as expected, but the second
does not produce an error. The "Save" button uses "Docmd.Save" to save
the record. If I insert "Me.Dirty = False" before "Docmd.Save" an
error is produced. Why doesn't "Docmd.Save" produce an error but
instead silently fails to save the record?

Any help appreciated.

Nov 13 '05 #3

P: n/a
On 4 Jun 2005 02:27:00 -0700, "WJA" <WJ****@hotmail.com> wrote:
I'm probably missing something here but I can't understand the
following. When 2 users try to save a record with the same primary key
(a number field), the first record saves as expected, but the second
does not produce an error. The "Save" button uses "Docmd.Save" to save
the record. If I insert "Me.Dirty = False" before "Docmd.Save" an
error is produced. Why doesn't "Docmd.Save" produce an error but
instead silently fails to save the record?

Any help appreciated.

I had a simular problem. The following is an answer sent to this newsgroup by
Rick Brant. He was right. His solution worked perfectly in my A97 database.

*****Is there a specific reason why you created a custom Close button? That is why
the record is being discarded silently. There has been a bug going back several
versions now wherein using DoCmd.Close to close a form will silently discard a
bad record instead of alerting the user to the problem. If you were to close
with the X in the upper right you would get an error message. You can keep the current button if you modify it to save the record before the
line that does the close. The line you need to add is... DoCmd.RunCommand acCmdSaveRecord
--I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

*****

Nov 13 '05 #4

P: n/a
WJA
Thanks for the replies and help.

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.