ByPassKey

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,
I have a form which I use to enable and disabla the bypasskey.
When I open the for I would like a label to be visible which says " Database
Secure" or "Database InSecure"
Whichever is correct at the time. What code would I use in the onopen event
of the form?

Regards

John
 
If CurrentDb.Properties("AllowBypassKey") = True Then
Me.lblSecure = "Database Insecure"
Else
Me.lblSecure = "Database Secure"
End If
 
<picky>
Since lblSecure is a label, not a text box, that needs to be

If CurrentDb.Properties("AllowBypassKey") = True Then
Me.lblSecure.Caption = "Database Insecure"
Else
Me.lblSecure.Caption = "Database Secure"
End If

As well, don't forget that the AllowBypassKey property doesn't exist by
default. Unless it's been explicitly created, referencing it will raise an
error 3270 ("Property Not Found")
</picky>
 
As always, Doug, thanks for the <picky>
The caption part is not really picky. It would also throw an error.
The 3270 error I forgot about. I was going to post my collection of
property manipulation functions which takes care of that, but I forgot which
mdb it is in.
I am in the process if collecting all my useful routines into one mdb, but I
must have missed that one.
 
Back
Top