473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Docmd.save Does Not Produce Error

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
4 3403
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
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
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
WJA
Thanks for the replies and help.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a...
2
by: Salad | last post by:
A97. I have a command button to save and exit. I had the code If Me.Dirty Then Docmd.RunCommand acCmdSaveRecord ...more code endif I was getting an error because a value was not getting...
2
by: Jonathan Goldman | last post by:
Hi- I have a relatively simple report that I open in an Access '97 VBA procedure, using the Docmd.OpenReport "rptName", acViewNormal syntax. The problem is that doing this usually crashes...
3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
3
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit...
0
by: ppardi | last post by:
I'm developing an addin for Word 2007 and I need to determine whether a user saves a Word 2007 document in an older format (97-2003) after a save as is done. The scenario is that the user starts...
2
by: aaronyoung | last post by:
I have been using this forum to answer many questions regarding an Access database I am building (my first attempt at something like this - teaching myself as I go), and I've always been able to find...
2
by: Wayne | last post by:
I've noticed a behaviour in A2007 that doesn't appear in A2003. The problem is appearing in a native A2007 database and an A2003 database running in A2007. If I press a command button to delete a...
26
mseo
by: mseo | last post by:
hi, I am developing a form for adding employees where you can find three fields in the table employees (firstname, middlename, lastname, hiredate (Is Not Null) and ADezii prompt me to use this code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.