check if sub form is locked

gearcam

Registered User.
Local time
Today, 00:35
Joined
Feb 7, 2008
Messages
30
I have a multi user database with many forms
I need to be able on one form with a sub form to know berfor it is updated if the sub form is locked by another user having the data open somewhere else.

Then if i know this i can enable an update button or not

Thanks
 
Have a look at this link for the correct syntax for referring to Forms/Subforms their controls and properties, from various relative locations.

Your code might look something like;
Code:
If Me!Subform1.Form.Locked = True Then
     MsgBox "Subform is locked"
Else
     MsgBox "Subform unlocked"
End If
 
Thanks

i have been trying to make this work but it does not capture the lock as on the attached image.

I am trying to do it now directley on the form so it sets a flag to say i am locked.

Steve
 

Attachments

  • lock.jpg
    lock.jpg
    67.9 KB · Views: 154
The subject on record locking is very broad and one that should be thoroughly understood before attempting. I would advise you look hard and deep into this subject.

I will tell you some solutions anyhow. If your form's Record Source was based on a Recordset then you could set the lock type. If you don't know how to do that then you can create a separate table that contains all your table names and set the flag when the form bound to that table is opened. Remove the flag when the form is closed.
 

Users who are viewing this thread

Back
Top Bottom