error 3219 Invalid Operation

R

Ray

I have managed to get a password function working using the code on this
Microsoft page.

http://support.microsoft.com/kb/209871

My code works perfectly if I create the table tblPassword within the active
..mdb file.

However, if I put the tblPassword table in another mdb and link it I get an
Error 3219 Invalid Operation message.

I am thinking towards the recordset part of the code which is as follows:

DoCmd.OpenForm "frmPassword", acNormal, , , , acDialog
Hold = MyPassword
' Open the table that contains the password.
Set db = CurrentDb
Set rs = db.OpenRecordset("tblPassword", dbOpenTable)
rs.Index = "PrimaryKey"
rs.Seek "=", Me.Name
If rs.NoMatch Then
MsgBox "Sorry cannot find password information. Try Again"
Cancel = -1
Else
' Test to see if the key generated matches the key in
' the table; if there is not a match, stop the form
' from opening.
If Not (rs![KeyCode] = KeyCode(CStr(Hold))) Then
MsgBox "Sorry you entered the wrong password." & _
"Try again.", vbOKOnly, "Incorrect Password"
Cancel = -1
DoCmd.Quit

Any help appreciated.

Thanks.

Ray
 

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