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. 4 3443
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.goo glegroups.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?
Try:
DoCmd.DoMenuIte m A_FORMBAR, A_FILE, A_SAVERECORD
instead of your expression.
-Ed
"WJA" <WJ****@hotmail .com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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.
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.RunComma nd acCmdSaveRecord
--I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com
*****
Thanks for the replies and help. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 BeforeUpdate Event
Procedure. There is nothing elaborate about the event, however, there
is an initial message box stating that if one field contains data then
a second one must also, and then after clicking okay, the
DoCmdMenuItem action box is...
|
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 set in the
BeforeUpdate event. So I changed it to
|
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 Access! No
error message is given, the thing just vanishes! Why? How do I fix
this?
|
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 works perfectly fine, but when I change the table name
argument (tblTest) to the name of a query, it fails and gives the
following error:
|
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 the Search button, a query is run to
search the Person table for a match. This produces a recordset (I am using
ADO).
If the RecordCount is zero, they get a No Match message.
If the RecordCount is 1, a DoCmd.OpenForm is performed to open the...
| |
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 out with a Word 2007 document,
saves that document to disk, then saves the same document in an older format
If the user saves a doc in an older format, I want to turn off certain
features of my add-in. I'm able to trap the save event easily...
|
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 solutions. My problem now has been addressed in other posts, but none of the solutions given are working for me.
The database will be used for tracking changes that I make to a customer's pricing, with forms based on queries that will allow me...
|
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 record on a
single form using DoCmd.RunCommand acCmdDeleteRecord as the code
behind the button, when I close that form Access asks me if I want to
save the changes to the form.
This only happens if the database is an mdb or accdb. If it has...
|
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 and it gives me the msgboxes which I need to be viewed to the user but after that It gives me an error because the code which I used for save cmdbutton is
private sub save_click()
docmd.save
docmd.requery (the error because of this I think)...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |