Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Location
    Houston, Texas, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invalid operation in code (Access 2000)

    I have a database where I run code from a button on a form. Two tables are involved - I create records in table 2 from table 1. This worked fine until I split the database. Table 2 is linked and when I get to the line of code referring to that table, I get an error stating 'invalid operation'.
    Any reason for this? I have used code like this before with linked tables and not had a problem.

    Thank you for any help!!!

    deutsch

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

    Re: Invalid operation in code (Access 2000)

    It's a bit hard to tell what the problem might be without seeing the code. Some operations don't work on linked tables, although they work fine on local tables.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Location
    Houston, Texas, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid operation in code (Access 2000)

    I am attaching a Word document showing the code. There is a box around the problem area. I guess my question is really:

    Is it possible to use vba code to write data to a linked table?
    Thank you for your help.
    Attached Files Attached Files

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

    Re: Invalid operation in code (Access 2000)

    The dbOpenTable argument in OpenRecordset does not work for linked tables. Replace it with dbOpenDynaset.

  5. #5
    Star Lounger
    Join Date
    Sep 2003
    Location
    Houston, Texas, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid operation in code (Access 2000)

    Thank you, Thank you that did the trick!!

    deutsch

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

    Re: Invalid operation in code (Access 2000)

    You see, once you posted the code, it was only a matter of minutes before your problem was solved. Without the code, <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

Posting Permissions

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