Connecting Tech Pros Worldwide Forums | Help | Site Map

Docmd.save Does Not Produce Error

WJA
Guest
 
Posts: n/a
#1: Nov 13 '05
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.


Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Docmd.save Does Not Produce Error


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" <WJA777@hotmail.com> wrote in message
news:1117877220.651613.120090@g49g2000cwa.googlegr oups.com...[color=blue]
> 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?[/color]


Ed Robichaud
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Docmd.save Does Not Produce Error


Try:
DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD


instead of your expression.
-Ed

"WJA" <WJA777@hotmail.com> wrote in message
news:1117877220.651613.120090@g49g2000cwa.googlegr oups.com...[color=blue]
> 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.
>[/color]


Chuck
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Docmd.save Does Not Produce Error


On 4 Jun 2005 02:27:00 -0700, "WJA" <WJA777@hotmail.com> wrote:
[color=blue]
>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.
>
>[/color]
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.

*****[color=blue]
>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.[/color]
[color=blue]
>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...[/color]
[color=blue]
>DoCmd.RunCommand acCmdSaveRecord[/color]

--[color=blue]
>I don't check the Email account attached
>to this message. Send instead to...
>RBrandt at Hunter dot com[/color]
*****

WJA
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Docmd.save Does Not Produce Error


Thanks for the replies and help.

Closed Thread