Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Object Invalid or no long set! (Access2000)

    This is driving me crazy.

    I have code something like this:

    dim tdef as dao.tabledef

    set tdef = currentdb.tabledefs(str)


    The "set tdef" line doesn't raise an error (as long as str contains a valid tablename), but if I immediately try to do anything with tdef, I get "Error 3420: Object Invalid or no longer set!". It is like it loses scope immediately after being set!

    At the same time, I've got tdef1 (defined same way) which is set via a For statement (For each tdef1 in currentdb.tabledefs), and works fine.

    Driving me crazy! Anyone have any ideas?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Object Invalid or no long set! (Access2000)

    I had this problem in Access 97 and worked around it by explicitly defining a Database object:

    Dim dbs As DAO.Database
    Dim tdef As DAO.TableDef

    Set dbs = CurrentDb
    Set tdef = dbs.TableDefs(...)

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Object Invalid or no long set! (Access2000)

    I'll give it a try. Just ridiculous.

    Thanks.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Object Invalid or no long set! (Access2000)

    CurrentDb can do that to you.
    Charlotte

Posting Permissions

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