473,385 Members | 1,848 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,385 software developers and data experts.

DoCmd.Save Problem with multiple users

10
Recently traced this problem: When multiple users are using an Access application I developed. A runtime error of 2501 occured in this code when the user tried to save a record:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. 'Provide the user with the option to save/undo
  3. 'changes made to the record in the form
  4.  
  5.     If MsgBox("Changes have been made to this record." _
  6.         & vbCrLf & vbCrLf & "Do you want to save these changes?" _
  7.         , vbYesNo, "Changes Made...") = vbYes Then
  8.             DoCmd.Save
  9.         Else
  10.             DoCmd.RunCommand acCmdUndo
  11.     End If
  12. End Sub
  13.  
Error occured on the DoCmd.Save command. This does not occur if only one user is in the application. Any suggestions why this is occuring?
Oct 16 '10 #1
5 5842
NeoPa
32,556 Expert Mod 16PB
Before we even start, let's have the error message posted shall we.
Oct 16 '10 #2
The error message was a 'runtime error 2501'. This is occuring on the DoCmd.Save command. Since posting this, I've learned that this command does not save the current form you are on. Someone on another site had given this as an example of doing it this way incorrectly. I was trying to give the user a chance to make the change or cancel it. I am still looking at a way at doing this.
Oct 17 '10 #3
munkee
374 256MB
If you are looking for a confirmation to save changes or not then use the following article:

http://www.databasedev.co.uk/prompt_to_save.html

I could have explained without but I think this is written really well and quite visual.

Good luck
Oct 18 '10 #4
NeoPa
32,556 Expert Mod 16PB
Bob, Please post using your account if you have one.

As for your problem, the event procedure the code is within, is Form_BeforeUpdate. This means that the record will be saved automatically unsless you specifically set the Cancel parameter as True (which enables the operator to get another go at it) or you clear the changes themselves using Call Me.Undo, which allows the process to continue but simply without the changes being saved.

Doing a .Save call from within that particular event procedure makes no logical sense, as it will save anyway if simply left alone (Hence the error message).
Oct 19 '10 #5
Helpful blog, bookmarked the website with hopes to read more!
Oct 21 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mary | last post by:
I am developing an Access db which will be used by multiple users. My questions are: Does MS Access have problems with multiple users accessing the db at once? If yes, what is your solution...
2
by: Paul Steele | last post by:
I am developing a client/server app and would like to use .NET Remoting to allow the server to communicate with clients. I've been able to test this with a single client, but .NET Remoting seems to...
0
by: Justice Gray | last post by:
The background to my problem: I have constructed a small web application. Each page of that web application contains a small user control I made, that has three sections: 1) imgCompany (of...
3
by: ~john | last post by:
I'm working on a multi-user system that at times may result in 2 users accessing the same screen. These screens allow the users to both view and update data. The problem comes when you have user A...
3
by: cga1982 | last post by:
I have a mdb front-end linked to a mdb back-end on another PC on our network. When I am running the application alone, everything is OK. Forms open up quickly and data is displayed quickly - no...
4
by: Jackson via AccessMonster.com | last post by:
Hi, I've got a form where multiple users will be 'booking' their trades. Several bound fields have on update/change requery code for the Form, this is to limit the rest of the fields based on...
4
beacon
by: beacon | last post by:
I'm having some trouble with my database (what's new, right?) and an error message that seems to appear somewhat randomly for the users that are accessing it. I'm using Access '03 and know it...
7
by: Supermansteel | last post by:
I have Access 2003. In my work environment we run a total of 30 tests between 5 people in my department. I am creating a database to combine all 30 tests so that way we can compile our results for...
0
by: kalinda | last post by:
I am trying to make multiple joins between two tables and am at a loss. I've tried a variety of things with this being the latest, but it pulls all records multiple times. Basically I have a main...
0
by: BobS | last post by:
Recently installed a small Access (2003) application for a non-profit association which I wrote on my home pc. Copied the database to a share volume and the Access mde to another shared volume with...
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
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.