error 3219 Invalid Operation

Discussion in 'Microsoft Access Form Coding' started by Guest, Jun 20, 2007.

  1. Guest

    Guest Guest

    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
     
    Guest, Jun 20, 2007
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jac
    Replies:
    11
    Views:
    3,430
    John Vinson
    Feb 29, 2004
  2. Guest

    Run-Time Error 3219

    Guest, Mar 16, 2004, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    393
    Guest
    Mar 16, 2004
  3. Jim Evans

    Help Needed:Error 3219 Invalid Operation When running a query

    Jim Evans, Sep 10, 2004, in forum: Microsoft Access Form Coding
    Replies:
    10
    Views:
    520
    Dirk Goldgar
    Sep 14, 2004
  4. Jim Evans

    Re: Help Needed:Error 3219 Invalid Operation When running a query

    Jim Evans, Sep 15, 2004, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    355
    Dirk Goldgar
    Sep 16, 2004
  5. Wuffles

    Split Database then error 3219

    Wuffles, Mar 26, 2010, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    498
    David W. Fenton
    Mar 29, 2010
Loading...

Share This Page