Looks like you've posted the example from the help file.
I've noticed that sometimes it doesn't work for me either. Basically, sometimes the error trapping part for if the property doesn't exist, doesn't work
So what you could do, to get around this, is just run this code first, to add the property (which is basically rephrasing the error trapping part of your code)
Code:
Function DoStuff()
Dim prp
Set prp = CurrentDb.CreateProperty("AllowByPassKey", 1, False)
CurrentDb.Properties.Append prp
End Function
Steven
I am a loud man with a very large hat. This means I am in charge