Password protecting a Form

  • Thread starter Thread starter Craigiharper
  • Start date Start date
C

Craigiharper

I am trying to password protect an individual form in my
database. I have followed the instructions in Knowledge
Base Article 209871 and the when i enter any password i
get a message saying 'Primary Key is not an Index in this
table' and the form opens up anyway no matter what
password is entered. I have checked all the code that i
have entered while following the instructions and i have
followed it letter for letter. Any ideas would be
gratefully received. Thanks!
 
Did you create the tblPassword and add a primary key to it? What's the name
of the primary key?

The code in the example uses PrimaryKey (no space), while the error message
you posted has Primary Key (with a space)
 
Many thanks, that works perfectly. I wonder if you could
tell me where i can change the password, i think it is in
the section of code under point 4 in the example in
article 209871, is this correct?
 
In step 9, you inserted a row into the table setting ObjectName to the name
of the form, and KeyCode to 2818. That 2818 value was what results from
passing the password PassWord to the KeyCode function in step 4.

Therefore, to change the password, pass whatever password you want to the
KeyCode function, and store whatever it returns in the table.

No offence, but if you don't understand the code in that article, perhaps
you shouldn't be using it, as it may lead to future problems for you.
 
Back
Top