I have created a database for a client and was told that it was to be a
one-user database. Well, you know the next statement ... now they want 3
people to be able to use the database. (FYI, I have never created a
database for multiusers. I've done some searching but not finding what I
want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared
Default record locking = Edited Record
Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer)
If Me.RecordLocks <> 2 Then
Me.RecordLocks = 2 'lock at the record level
End If
End Sub
Private Sub Form_Dirty(Canc el As Integer)
Me.cmdSave.Visi ble = True
Me.cmdUndo.Visi ble = True
Me.cmdAdd.Visib le = False
Me.ComboStudent .Enabled = False
Me.cmdDelete.Vi sible = False
End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and
tried to edit the same record. I get the Locked Record Indicator but
Form_Dirty is activated if they attempt to make a change, so the Save and
Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do so
the Form_Dirty doesn't activate? I thought it would be a nice feature to
use a msgbox to tell the 2nd user that someone else is editing the same
record.
I will have a lot of forms to change so the easiest way I can do this the
better.
Thanks in advance for any suggestions/help,
Debbie 6 5680
On Fri, 7 May 2004 00:56:21 -0500, "DebbieG"
<debbieg@access us-REMOVE-THIS-.net> wrote:
Optimistic locking (.RecordLocks=0 ) typically is sufficient. This
means multiple users can edit the same record at the same time, and if
they save, the one that was a millisecond quicker to hit the button
saves first, immediately being overwritten by the changes made by the
other user. Typically that is fine.
I don't think there is a way to do what you asked - capture the Locked
Record indicator. However, you can train your users on observing it.
-Tom. I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared Default record locking = Edited Record Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer) If Me.RecordLocks <> 2 Then Me.RecordLocks = 2 'lock at the record level End If End Sub
Private Sub Form_Dirty(Canc el As Integer) Me.cmdSave.Visi ble = True Me.cmdUndo.Visi ble = True Me.cmdAdd.Visib le = False Me.ComboStudent .Enabled = False Me.cmdDelete.Vi sible = False End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and tried to edit the same record. I get the Locked Record Indicator but Form_Dirty is activated if they attempt to make a change, so the Save and Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do so the Form_Dirty doesn't activate? I thought it would be a nice feature to use a msgbox to tell the 2nd user that someone else is editing the same record.
I will have a lot of forms to change so the easiest way I can do this the better.
Thanks in advance for any suggestions/help, Debbie
Tom,
Thank you for your response. I do not want users to be able to edit the
same record at the same time so I have to keep it the way it is. However,
when I try to edit a locked record, it does beep and doesn't allow editing.
Isn't there a way to capture this somehow? Access knows it is locked, so
why does it think the record is dirty when they attempt to edit? What I
really want is for the Save and Undo button not to appear. That is their
clue that they can do something.
Thanks,
Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message
news:vo******** *************** *********@4ax.c om...
On Fri, 7 May 2004 00:56:21 -0500, "DebbieG"
<debbieg@access us-REMOVE-THIS-.net> wrote:
Optimistic locking (.RecordLocks=0 ) typically is sufficient. This
means multiple users can edit the same record at the same time, and if
they save, the one that was a millisecond quicker to hit the button
saves first, immediately being overwritten by the changes made by the
other user. Typically that is fine.
I don't think there is a way to do what you asked - capture the Locked
Record indicator. However, you can train your users on observing it.
-Tom. I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared Default record locking = Edited Record Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer) If Me.RecordLocks <> 2 Then Me.RecordLocks = 2 'lock at the record level End If End Sub
Private Sub Form_Dirty(Canc el As Integer) Me.cmdSave.Visi ble = True Me.cmdUndo.Visi ble = True Me.cmdAdd.Visib le = False Me.ComboStudent .Enabled = False Me.cmdDelete.Vi sible = False End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and tried to edit the same record. I get the Locked Record Indicator but Form_Dirty is activated if they attempt to make a change, so the Save and Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do so the Form_Dirty doesn't activate? I thought it would be a nice feature to use a msgbox to tell the 2nd user that someone else is editing the same record.
I will have a lot of forms to change so the easiest way I can do this the better.
Thanks in advance for any suggestions/help, Debbie
On Fri, 7 May 2004 09:52:40 -0500, "DebbieG"
<debbieg@access us-REMOVE-THIS-.net> wrote:
I know Access knows. But it is not exposing that to the developer,
afaik.
I do agree with you that it's strange that the Dirty event fires for
the second user. I noticed that too when I ran a test. This seems
contra to what the help file says about the Dirty event. Perhaps we
can resort to some trickery to detect we can't edit, and then not
enable the buttons:
Private Sub Form_Dirty(Canc el As Integer)
If Me.Dirty Then
Me.cmdSave.Visi ble = True
Me.cmdUndo.Visi ble = True
Me.cmdAdd.Visib le = False
Me.ComboStudent .Enabled = False
Me.cmdDelete.Vi sible = False
End If
End Sub
-Tom. Tom,
Thank you for your response. I do not want users to be able to edit the same record at the same time so I have to keep it the way it is. However, when I try to edit a locked record, it does beep and doesn't allow editing. Isn't there a way to capture this somehow? Access knows it is locked, so why does it think the record is dirty when they attempt to edit? What I really want is for the Save and Undo button not to appear. That is their clue that they can do something.
Thanks, Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message news:vo******* *************** **********@4ax. com... On Fri, 7 May 2004 00:56:21 -0500, "DebbieG" <debbieg@acces sus-REMOVE-THIS-.net> wrote:
Optimistic locking (.RecordLocks=0 ) typically is sufficient. This means multiple users can edit the same record at the same time, and if they save, the one that was a millisecond quicker to hit the button saves first, immediately being overwritten by the changes made by the other user. Typically that is fine.
I don't think there is a way to do what you asked - capture the Locked Record indicator. However, you can train your users on observing it.
-Tom.
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared Default record locking = Edited Record Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer) If Me.RecordLocks <> 2 Then Me.RecordLocks = 2 'lock at the record level End If End Sub
Private Sub Form_Dirty(Canc el As Integer) Me.cmdSave.Visi ble = True Me.cmdUndo.Visi ble = True Me.cmdAdd.Visib le = False Me.ComboStudent .Enabled = False Me.cmdDelete.Vi sible = False End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and tried to edit the same record. I get the Locked Record Indicator but Form_Dirty is activated if they attempt to make a change, so the Save and Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do so the Form_Dirty doesn't activate? I thought it would be a nice feature to use a msgbox to tell the 2nd user that someone else is editing the same record.
I will have a lot of forms to change so the easiest way I can do this the better.
Thanks in advance for any suggestions/help, Debbie
THAT DID IT! You're wonderful!
Thanks,
Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message
news:vv******** *************** *********@4ax.c om...
On Fri, 7 May 2004 09:52:40 -0500, "DebbieG"
<debbieg@access us-REMOVE-THIS-.net> wrote:
I know Access knows. But it is not exposing that to the developer,
afaik.
I do agree with you that it's strange that the Dirty event fires for
the second user. I noticed that too when I ran a test. This seems
contra to what the help file says about the Dirty event. Perhaps we
can resort to some trickery to detect we can't edit, and then not
enable the buttons:
Private Sub Form_Dirty(Canc el As Integer)
If Me.Dirty Then
Me.cmdSave.Visi ble = True
Me.cmdUndo.Visi ble = True
Me.cmdAdd.Visib le = False
Me.ComboStudent .Enabled = False
Me.cmdDelete.Vi sible = False
End If
End Sub
-Tom. Tom,
Thank you for your response. I do not want users to be able to edit the same record at the same time so I have to keep it the way it is. However, when I try to edit a locked record, it does beep and doesn't allow editing. Isn't there a way to capture this somehow? Access knows it is locked, so why does it think the record is dirty when they attempt to edit? What I really want is for the Save and Undo button not to appear. That is their clue that they can do something.
Thanks, Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message news:vo******* *************** **********@4ax. com... On Fri, 7 May 2004 00:56:21 -0500, "DebbieG" <debbieg@acces sus-REMOVE-THIS-.net> wrote:
Optimistic locking (.RecordLocks=0 ) typically is sufficient. This means multiple users can edit the same record at the same time, and if they save, the one that was a millisecond quicker to hit the button saves first, immediately being overwritten by the changes made by the other user. Typically that is fine.
I don't think there is a way to do what you asked - capture the Locked Record indicator. However, you can train your users on observing it.
-Tom.
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared Default record locking = Edited Record Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer) If Me.RecordLocks <> 2 Then Me.RecordLocks = 2 'lock at the record level End If End Sub
Private Sub Form_Dirty(Canc el As Integer) Me.cmdSave.Visi ble = True Me.cmdUndo.Visi ble = True Me.cmdAdd.Visib le = False Me.ComboStudent .Enabled = False Me.cmdDelete.Vi sible = False End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and tried to edit the same record. I get the Locked Record Indicator but Form_Dirty is activated if they attempt to make a change, so the Save and Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do
sothe Form_Dirty doesn't activate? I thought it would be a nice feature to use a msgbox to tell the 2nd user that someone else is editing the same record.
I will have a lot of forms to change so the easiest way I can do this the better.
Thanks in advance for any suggestions/help, Debbie
Tome,
I celebrated a little too soon. This works on the 2nd user but now it
doesn't fire on the 1st user. I tried moving this code to OnCurrent but
that didn't work either. Did it work on your test?
Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message
news:vv******** *************** *********@4ax.c om...
On Fri, 7 May 2004 09:52:40 -0500, "DebbieG"
<debbieg@access us-REMOVE-THIS-.net> wrote:
I know Access knows. But it is not exposing that to the developer,
afaik.
I do agree with you that it's strange that the Dirty event fires for
the second user. I noticed that too when I ran a test. This seems
contra to what the help file says about the Dirty event. Perhaps we
can resort to some trickery to detect we can't edit, and then not
enable the buttons:
Private Sub Form_Dirty(Canc el As Integer)
If Me.Dirty Then
Me.cmdSave.Visi ble = True
Me.cmdUndo.Visi ble = True
Me.cmdAdd.Visib le = False
Me.ComboStudent .Enabled = False
Me.cmdDelete.Vi sible = False
End If
End Sub
-Tom. Tom,
Thank you for your response. I do not want users to be able to edit the same record at the same time so I have to keep it the way it is. However, when I try to edit a locked record, it does beep and doesn't allow editing. Isn't there a way to capture this somehow? Access knows it is locked, so why does it think the record is dirty when they attempt to edit? What I really want is for the Save and Undo button not to appear. That is their clue that they can do something.
Thanks, Debbie
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message news:vo******* *************** **********@4ax. com... On Fri, 7 May 2004 00:56:21 -0500, "DebbieG" <debbieg@acces sus-REMOVE-THIS-.net> wrote:
Optimistic locking (.RecordLocks=0 ) typically is sufficient. This means multiple users can edit the same record at the same time, and if they save, the one that was a millisecond quicker to hit the button saves first, immediately being overwritten by the changes made by the other user. Typically that is fine.
I don't think there is a way to do what you asked - capture the Locked Record indicator. However, you can train your users on observing it.
-Tom.
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared Default record locking = Edited Record Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer) If Me.RecordLocks <> 2 Then Me.RecordLocks = 2 'lock at the record level End If End Sub
Private Sub Form_Dirty(Canc el As Integer) Me.cmdSave.Visi ble = True Me.cmdUndo.Visi ble = True Me.cmdAdd.Visib le = False Me.ComboStudent .Enabled = False Me.cmdDelete.Vi sible = False End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and tried to edit the same record. I get the Locked Record Indicator but Form_Dirty is activated if they attempt to make a change, so the Save and Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do
sothe Form_Dirty doesn't activate? I thought it would be a nice feature to use a msgbox to tell the 2nd user that someone else is editing the same record.
I will have a lot of forms to change so the easiest way I can do this the better.
Thanks in advance for any suggestions/help, Debbie
I finally found what I needed. I found it on the Microsoft Knowledge Base
(article 122294 - How to automatically detect if a form is being edited).
There were two methods suggested and I chose to use the Dirty Property in an
Expression. In summary, here's what worked:
I created the following function in the module:
Function EditModeChange (F as Form) as Variant
If F.Dirty then
F!cmdSave.Visib le = True
F!cmdUndo.Visib le = True
F!cmdAdd.Visibl e = False
F!ComboStudent. Enabled = False
F!cmdDelete.Vis ible = False
else
F!cmdSave.Visib le = False
F!cmdUndo.Visib le = False
F!cmdAdd.Visibl e = True
F!ComboStudent. Enabled = True
F!cmdDelete.Vis ible = True
End If
End Function
I added a new textbox to my form:
Name: txtEditModeChan ge
Control Source: =[Form].[Dirty] & EditModeChange([Form])
Visible: No
In Form_AfterUpdat e:
Sub Form_AfterUpdat e()
Me!txtEditModeC hange.Requery
End Sub
Now, if a second user tries to edit the same record as someone else the Save
and Undo buttons don't appear.
Hope this helps someone else.
Debbie
"DebbieG" <debbieg@access us-REMOVE-THIS-.net> wrote in message
news:j5******** ************@ac cessus.net...
I have created a database for a client and was told that it was to be a
one-user database. Well, you know the next statement ... now they want 3
people to be able to use the database. (FYI, I have never created a
database for multiusers. I've done some searching but not finding what I
want.)
I have split the database. In Tools, Options, I have set the following:
Default open mode = Shared
Default record locking = Edited Record
Checked Open databases using record-level locking
And this is some of the code behind one of my forms:
Private Sub Form_Open(Cance l As Integer)
If Me.RecordLocks <> 2 Then
Me.RecordLocks = 2 'lock at the record level
End If
End Sub
Private Sub Form_Dirty(Canc el As Integer)
Me.cmdSave.Visi ble = True
Me.cmdUndo.Visi ble = True
Me.cmdAdd.Visib le = False
Me.ComboStudent .Enabled = False
Me.cmdDelete.Vi sible = False
End Sub
I reset the above in Form_Current.
In testing to see how my form will react, I opened the database twice and
tried to edit the same record. I get the Locked Record Indicator but
Form_Dirty is activated if they attempt to make a change, so the Save and
Undo buttons appear, but the user can't change anything.
Is there a way to capture the Locked Record Indicator? Or what can I do so
the Form_Dirty doesn't activate? I thought it would be a nice feature to
use a msgbox to tell the 2nd user that someone else is editing the same
record.
I will have a lot of forms to change so the easiest way I can do this the
better.
Thanks in advance for any suggestions/help,
Debbie This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David C. Barber |
last post by:
I'm trying to determine which user has locked a given record from VB6.
I know I can use sp_lock and sp_who, and match up the data to determine
which users have locked records in my database, however I haven't seen a way
to match the specific user to the specific record. What am I missing here?
Thanks!
*David*
|
by: Anastassios Giannaras |
last post by:
Hello
I have made an small access Database that is used by 4-5 people every
day. Very often through the users get the message "Could Not Update;
Currently Locked" There is an entry about that problem in the MS
knowledge Base but I don't really understand how this could be solved.
I would be extremely greatful if someone could explain to me in simple
terms (if possible)what I need to do...
|
by: BillB |
last post by:
When I activate frmList.List0, it positions at the end of the table:
- frmList
Private Sub Form_Activate()
Me.List0.SetFocus
Me.List0.ListIndex = Me.List0.ListCount - 1
-
When I DblClick a row in frmList.List0, I close frmList and open frmEdit to
edit record I clicked on:
-frmList
|
by: ethanj /personal/ |
last post by:
We are using Access 2000 database, with the following settings.
Tool > Options > Advance >
Default Record Locking = Edited Record
Open databases using record level locking = True
Form property >
RecordLock = Edited Record.
However, the record is still NOT locked. Multiple users can still open
|
by: Rolan |
last post by:
Having tried various permutations of Before Update and well for that
matter, After Update, OnExit, OnEnter, etc. and also Locked controls,
I'm still unable to obtain the intended results. There are actually two
parts of what I'm trying to accomplish, but are interrelated. When one
part performs as it should, then upon implementation of the other,
conflicts arise and vice versa.
A form (frmEvents) is used to logged various events and one...
| |
by: andrew.newell |
last post by:
Hi,
I use MS Access to connect to and SQL Database this has been working
fine until recently.
Whenever I add a new record (post record 723) it does not allow me to
change it. My DBA has checked in the SQL server and the record is not
locked it seems that it is only locked when connecting through Access.
Does anybody have any ideas?
|
by: Access Programming only with macros, no code |
last post by:
ERROR MESSAGE:
Could not update; currently locked by another session on this
machine.
BACKGROUND
I have the following objects:
Table1 - HO (which has about 51,000+ records)
Table2 - Contact (which has 68,000+ records)
|
by: ljstern |
last post by:
Hello. I am using MS Access 2003 with XP/pro. I have a form that has the following properties set through the property sheet:
form: AllowAdditions = False
CartridgeID field: Locked = True
The AllowAdditions property is set so that the user can navigate through the records but not be able to begin a new record without clicking the New Record button. The ID field is locked so the user cannot change that field, while still being able to...
|
by: breal |
last post by:
I have a db table that holds a list of ports. There is a column
in_use that is used as a flag for whether the port is currently in
use. When choosing a port the table is read and the first available
port with in_use = 0 is used, updated to in_use = 1, used, then
updated to in_use = 0. I am using MySQLdb and want to make sure I am
locking the table when doing reads, writes, updates since there will
be several instances of my program...
|
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: 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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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: 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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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: 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...
| |