steveanders
Programmer
Hi
I have an mdb I am converting to an adp. The client asked that the shift bypass key be disabled. In the mdb I did this by using this code on exit of the main form: -
CurrentDb.Properties("AllowBypassKey") = False
The method I used to set the property back to True was to have another mdb that ran this function: -
Function hackBD()
On Error GoTo Err_hackBD
Dim tdb As DAO.Database
Dim varCreateProperty As Variant
Set tdb = OpenDatabase("Path_of_mdb")
tdb.Properties("Allowbypasskey") = True
tdb.Close
Set tdb = Nothing
Exit_hackBD:
Exit Function
Err_hackBD:
Select Case Err
Case 3270 ' Property not found
Set varCreateProperty = tdb.CreateProperty("AllowBypassKey", 1, True)
tdb.Properties.Append varCreateProperty
Case Else
MsgBox Err.Number & " " & Err.Description, , "hackBDSub"
Resume Exit_hackBD
End Select
I have found the replacement code for the exit function on the main form on the microsoft site: -
CurrentProject.Properties.Add "AllowBypassKey" = False
I am having trouble converting the code for the function.
Can anybody help.
I apologise if this is a simple request. This is the first conversion I have attempted.
Thx
I have an mdb I am converting to an adp. The client asked that the shift bypass key be disabled. In the mdb I did this by using this code on exit of the main form: -
CurrentDb.Properties("AllowBypassKey") = False
The method I used to set the property back to True was to have another mdb that ran this function: -
Function hackBD()
On Error GoTo Err_hackBD
Dim tdb As DAO.Database
Dim varCreateProperty As Variant
Set tdb = OpenDatabase("Path_of_mdb")
tdb.Properties("Allowbypasskey") = True
tdb.Close
Set tdb = Nothing
Exit_hackBD:
Exit Function
Err_hackBD:
Select Case Err
Case 3270 ' Property not found
Set varCreateProperty = tdb.CreateProperty("AllowBypassKey", 1, True)
tdb.Properties.Append varCreateProperty
Case Else
MsgBox Err.Number & " " & Err.Description, , "hackBDSub"
Resume Exit_hackBD
End Select
I have found the replacement code for the exit function on the main form on the microsoft site: -
CurrentProject.Properties.Add "AllowBypassKey" = False
I am having trouble converting the code for the function.
Can anybody help.
I apologise if this is a simple request. This is the first conversion I have attempted.
Thx