Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL statement (Access 97)

    Hi

    On opening a form I wish to check info in a table so I can set certain information in the form. However, I keep getting the following error message:

    3420 "Object Invalid or No Longer Set

    The code I am using in the open form event is:

    Dim dbs As Database
    Dim rst As Recordset
    Dim strSQL As String
    Set dbs = currentDB()
    strSQL = "SELECT * FROM [Invoice]"
    strSQL = strSQL & " WHERE not isnull([Invoice.Auth_date]) and isnull([Invoice.Print_Date])

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: SQL statement (Access 97)

    On which instruction is the error?
    Pat

  3. #3
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL statement (Access 97)

    Hi

    I think I have just solved it (a bit of code in the wrong spot further on). Thanks for the offer of assistance.

    Regards
    WTH

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: SQL statement (Access 97)

    You seem to have [ ] brackets wrongly placed. Put them around field names, but not the table name.

    strSQL = "SELECT * FROM Invoice"
    strSQL = strSQL & " WHERE not isnull(Invoice.[Auth_date]) and isnull(Invoice.[Print_Date])
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •