How to pop up a message when the field is locked?

sirkistova

Registered User.
Local time
Today, 05:39
Joined
May 3, 2009
Messages
23
Hello
I made an "Options" form in my DB to edit some fields.
When a field is used by a reoprt that is open, that fields in "Options" form is locked.
This is fine, but the user has to know why is it suddenly locked.
How can I make it pop up a message when the field is locked due to report that uses it open?
Thanks
Tova
 
If the field is locked but still enabled you can use the GotFocus event of that control and use:
Code:
If Me.ControlName.Locked = True Then
   MsgBox "This control is locked because....etc.", vbInformation
End If
 
I tried that but the value of Me.ControlName.Locked
is always false. Even when it is really locked.
:(
Tova
 
I tried that but the value of Me.ControlName.Locked
is always false. Even when it is really locked.
I just tested on my own form and it doesn't do what you are saying happens. It actually works fine for me, so I need more information as to what may be happening.

Please explain how you are trying to implement it.
 
This is the function:

Public Function event_PetekFooter_GetFocus()
MsgBox Me.PetekFooter.Locked
If Me.PetekFooter.Locked = True Then
MsgBox "This field is locked because a report that uses it is open.", vbInformation
End If
End Function

It is located at the code of the form.
The line: MsgBox Me.PetekFooter.Locked
is for debugging. The msgbox always shows False, even when the field is blocked and beeps when I try to edit it.

Thanks
Tova
 
Have you considered bypassing the problem? If you open the report with WindowMode=acDialog, then the focus stays on the report until it's closed.
 

Users who are viewing this thread

Back
Top Bottom