By Code, Is A record being Edited by another user

D

DDBeards

I have a multi user system "Shared" "Edited Record" are set and I do get the
message that says another user is updateing the record already. However, the
user does not like that. What they want is not to be able to enter any text
into a field if someone else is currently editing that record. Is there some
type of code that I can run in an IF statement to see if the record is Locked?

Thanks
 
A

Albert D. Kallal

Unfortunately, you can't have two users editing the record at the same time.
Someone will have to be the "victim".

However, what you can do is set the locking of the form to "edited record".
(see the forms data tab in design view).

Try setting the Record Locks for the form to Edited record.

If you do the above, and two users are looking at the same record, the
"instant" one user starts to type or edit, the record is NOW locked. Any
other users can view the record, but they WILL NOT be able to modify the
record until that one user is done.

Other users will see a red ghost-busters symbol in the record selector bar
and will not be able to type.
 
A

Albert D. Kallal

just as a follow-up, the symbol is NOT red....

also, while you can change the setting in tools->options, htat really only
sets the DEFAULT used, you have to go on a form by form basis to chagne this
setting to whatever you want.....


So, you still have to change this in the particlar form where you only want
one user to be able to start editing the form's data at one time.....
 
D

DDBeards

the edited record is already set and the victim can edit data on the screen
because they will not be told the record is being editted by someone else
until they move the control from the record. I want to prevent them from
doing this by simply checking to see if the record is locked before they
start typing.
 
A

Albert D. Kallal

DDBeards said:
the edited record is already set and the victim can edit data on the
screen

No they, WILL not be able make changes if you set the form locking to
Edited record (as mentioned, you have to set this on a form by form bases).

When you do the above the first user who starts typing will lock that
record, and ALL OTHER users will NOT be able to edit that record. They can
view it..but they will get the lock icon in the record selector bar. And
they CAN NOT MAKE changes. (and therefore cannot become a victim and loose
changes they make - they can't make any changes!). This
setting only works for jet back end, not odbc to sql server.

So, if you set this correctly, then ONLY the first user who starts to
type/edit the record will be able to make changes, and all others users
will not be able to make chances to anything on that form.
 

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