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)
Set prp = CurrentDb.CreateProperty("AllowByPassKey", 1, False)
I am a loud man with a very large hat. This means I am in charge