Check to see if another user has changed a record?

  • Thread starter Thread starter Blue
  • Start date Start date
B

Blue

(Access 2000). Is there a way, using VB, to see if another user has
modified a record on a form?

ie:

User 1 opens a form, displays the first record.
User 2 opens a form and displays the same record
User 2 changes (and saves) the record

User 1 now wants to modifiy the record. Is there a way to check to see if
User2 has modified it before trying to save?


TIA
 
Not really.

Just train the users in how to handle the conflict dialog.
 
If you really want to go to the work to do it, I suppose you could create a
timestamp field where you update the date/time to Now() in the BeforeUpdate
of the form so that it gets updated before saving. Then, you could:

1. Create a bound control that contains the value of the timestamp.
2. Insert a DLookup of that field immediately before you update the timestamp.
3. Compare the results of the DLookup to the value of the timestamp control
on your form.

I agree with Allen, though; I think it is probably better to just let your
record-level locking do its job and deal with the resultant messages.

However, on the off chance that you might want to save the 2nd user's input
to a new record, you could alternatively create an append query that reads
the value of the various controls ([Forms]![FormName]![ControlName] and run
this query after #3 when there is a conflict with user #1.
 

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

Back
Top