VBA Datatype conversion error

P

Philip

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
 
A

Allen Browne

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top