repost - two front-end users were able to update same record

G

Guest

I have this code on my form since my Lender ID is not autonumber, I had
problems (before) updating my records..

Private Sub Form_Current()

If Me.NewRecord Then
Me.txtLenderID.Enabled = True
Else
Me.txtLenderID.Enabled = False
End If

Exit Sub

End Sub

Is there any way to make a unique id so the front-ends cannot update the
same record at the same time? Thanks again.
 
R

Ron2006

Is the update process that is causing the problem via a macro/query,
or are you having problems with two people sitting on the record at the
same time in a form.??


=========


Add an autonumber to the records but never show it to the user, and
have your forms etc use this autonumber.

Ron
 
G

Guest

Both users can update the same Lender ID with different information (since I
did not set it as an auto-number/unique ID when I created my table).
 
R

Ron2006

We repeat:

Is the update process that is causing the problem via a macro/query,
or are you having problems with two people sitting on the record at the

same time in a form.??
 
R

Ron2006

Now I am really confused. The subject says :
two front-end users were able to update same record

But the hidden text on the first message seems to be talking about
creating duplicate records. Those to two entirely different things and
I don't know which it is.
 
G

Guest

I already split my database. There are currently just 2 users. We tried to
update the same record number and ended up doing so with different data.
When I was the only one using the database, I would manually input the Lender
ID number on the form then the Lender ID text box will be enabled after I
input the next record number. I hope that made sense.
 
R

Rick Brandt

Freeda said:
I already split my database. There are currently just 2 users. We
tried to update the same record number and ended up doing so with
different data. When I was the only one using the database, I would
manually input the Lender ID number on the form then the Lender ID
text box will be enabled after I input the next record number. I
hope that made sense.

No it does not. Having two users enter NEW records with the same ID number is a
completely different issue from having two users simultaneously edit an EXISTING
record. In all of your posts I have not been able to ascertain which of these
issues you are trying to address.

The NEW records isue is solved by making that field the Primary Key or putting a
unique index on it. Then if two users try to use the same number whoever saves
their entry last will get an error and will not be able to continue.

The EXISTING records issue is solved by setting your Record Locking on the form
so that simultaneous editing of the same record will also cause the second user
to save to get an error.
 
G

Guest

Hi Ron and Rick

Thanks so much for your help. I'm sorry if I'm not very clear with my
explanations. I guess the root of my problem is my Lender ID in not an
auto-number thus, I don't have a unique ID to enable the first user to lock
the record (for new records; and this allows the other user to populate the
same record ID with different data).
 
R

Rick Brandt

Freeda said:
Hi Ron and Rick

Thanks so much for your help. I'm sorry if I'm not very clear with my
explanations. I guess the root of my problem is my Lender ID in not
an auto-number thus, I don't have a unique ID to enable the first
user to lock the record (for new records; and this allows the other
user to populate the same record ID with different data).

"Rick Brandt" wrote:

Sorry but this is still mish-mash.

You DO need a unique ID number for every record inserted.

You DO need to lock edited records so that only one user at a time can edit
a particular record.

BUT...the two statements above have nothing to do with each other. They
are completely separate concepts.

I still can't tell if you are trying to avoid two users creating separate
records with the same ID value or if you are trying to prevent two users
from editing the same record at the same time.
 
G

Guest

Yes, I want to prevent two users from creating separate records with the same
ID number. So, can my question now be, how do I create a unique ID when I
already have almost 400 records on my database.
 
R

Rick Brandt

Freeda said:
Yes, I want to prevent two users from creating separate records with
the same ID number. So, can my question now be, how do I create a
unique ID when I already have almost 400 records on my database.

Fix any existing duplicates manually, then open the table in design view and
either make that field the Primary Key for the table or (if there is already a
PK) set it to "Indexed - No Duplicates"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top