Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change property of an adp using another mdb

Status
Not open for further replies.

steveanders

Programmer
Jun 20, 2006
1
GB
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 :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top