VBA Datatype conversion error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to run the below code to prevent the user being able to bypass
the startup code in AutoExec (by holding down the SHIFT key when the db
opens):
Dim prp

Set prp = CurrentDb.CreateProperty("AllowBypassKey", vbBoolean, bAllowIt,
True)
' Set prp = CurrentDb.CreateProperty("AllowBypassKey", vbBoolean, True, True)
CurrentDb.Properties.Append prp

Set prp = Nothing
<<< END CODE <<<<

I always get a datatype conversion error when trying to run the
CreateProperty code (I have passed a boolean True to the variable bAllowIt).

Please can someone help me to get this code running.

thanks

Philip
 
Be specific about the library you want the property from:
Dim prp AS DAO.Property

Skip the DLL property (i.e. omit the last True.)
 
Back
Top