Hi there,
I did a search and found thread702-1038368, but it is archived... I've also gone through about 20 other threads all having to do with record locking, etc...
Here's what I'm trying to do:
I have a form, in a multi-user Access DB, that runs on top of a pre-built query. The form's record locking property is set to "Edited" (pessimistic). This achieves the first part of my goal, which is to not allow two people to edit the same record at the same time... Now I need to address the second part of my goal, which is to detect if the first record in the querey is currently locked (on form load or open) and, thus, move to the next available record.
Example: UserA is editing a record. UserB opens the same form (in a shared DB) and sees the same record. UserB can't make changes to that record... that's fine, but what I want is for UserB to not even SEE the record, and just have the form detect that the first record is locked and then move on to the second one automatically when the form loads. This way, users can always be garunteed a fresh, editable record when they open the form.
The way I have been attempting to do it, is to just add an IF statement to the onOpen (or onLoad) event that just checks if the first record is locked and, if so, runs a DoCmd... acNext and shows the user the next record. The only problem is that I am stuck trying to figure out how to detect if the current record is locked...
I've looked at everything I could find in the VBA help menu that has the words "locked" or "record" or both...
Anyway, any insight would be greatly appreciated!
I did a search and found thread702-1038368, but it is archived... I've also gone through about 20 other threads all having to do with record locking, etc...
Here's what I'm trying to do:
I have a form, in a multi-user Access DB, that runs on top of a pre-built query. The form's record locking property is set to "Edited" (pessimistic). This achieves the first part of my goal, which is to not allow two people to edit the same record at the same time... Now I need to address the second part of my goal, which is to detect if the first record in the querey is currently locked (on form load or open) and, thus, move to the next available record.
Example: UserA is editing a record. UserB opens the same form (in a shared DB) and sees the same record. UserB can't make changes to that record... that's fine, but what I want is for UserB to not even SEE the record, and just have the form detect that the first record is locked and then move on to the second one automatically when the form loads. This way, users can always be garunteed a fresh, editable record when they open the form.
The way I have been attempting to do it, is to just add an IF statement to the onOpen (or onLoad) event that just checks if the first record is locked and, if so, runs a DoCmd... acNext and shows the user the next record. The only problem is that I am stuck trying to figure out how to detect if the current record is locked...
I've looked at everything I could find in the VBA help menu that has the words "locked" or "record" or both...
Anyway, any insight would be greatly appreciated!