S
SR
Hi,
Can someone please tell me where I am going wrong?
I am trying to learn how to do this so that I can build a more complex
procedure but need the basic blocks.
I have the following simple code in Access 2002 to loop through the
table...............
However, I keep getting an "Run Time error 3001" error on the line "Set rst
= dbs.OpenRecordset(strTable, dbOpenDynamic)"
Thanks
Simon
Sub Test01()
Dim dbs As Database
Dim rst As Recordset
Dim strPath As String
Dim strTable As String
strPath = "P:\Bec2003\Bec2003_be.mdb"
strTable = "tblCLIENT"
Set dbs = OpenDatabase(strPath)
Set rst = dbs.OpenRecordset(strTable, dbOpenDynamic)
Do While Not rst.EOF
Debug.Print rst("RecNo")
Loop
dbs.Close
rst.Close
End Sub
Can someone please tell me where I am going wrong?
I am trying to learn how to do this so that I can build a more complex
procedure but need the basic blocks.
I have the following simple code in Access 2002 to loop through the
table...............
However, I keep getting an "Run Time error 3001" error on the line "Set rst
= dbs.OpenRecordset(strTable, dbOpenDynamic)"
Thanks
Simon
Sub Test01()
Dim dbs As Database
Dim rst As Recordset
Dim strPath As String
Dim strTable As String
strPath = "P:\Bec2003\Bec2003_be.mdb"
strTable = "tblCLIENT"
Set dbs = OpenDatabase(strPath)
Set rst = dbs.OpenRecordset(strTable, dbOpenDynamic)
Do While Not rst.EOF
Debug.Print rst("RecNo")
Loop
dbs.Close
rst.Close
End Sub