none
Run Time Errror 3001 RRS feed

  • Question

  • Can someone please explain why I get the following error when the below code gets to:  Set rs = db.OpenRecordset("Budget", OpenTable).  

    "Run-Time Errror 3001 Invalid Argument"

    The code is in an Excel 2010 file and I am using Access 2003.

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim r As Long
       
        Set db = OpenDatabase("D:\TEST.mdb")
       
        ' open the database
        Set rs = db.OpenRecordset("Budget", OpenTable) ' << Error when this line executes.

    Can anyone advise what I'm doing wrong, thanks?


    • Edited by Gazza101 Wednesday, May 16, 2012 9:11 AM
    Wednesday, May 16, 2012 9:10 AM

Answers

  • I seem to have solved this myself. I have changed the offending code to:

    Set rs = db.OpenRecordset("Budget")

    Seems to work ok now.

    • Marked as answer by Gazza101 Wednesday, May 16, 2012 9:29 AM
    Wednesday, May 16, 2012 9:29 AM