Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Recordset...

Status
Not open for further replies.

hedidit

Technical User
Jul 21, 2005
142
0
0
GB
Can someone show me the code of how to open a VBA recordset? I have a query I'd like to mess around with via VBA... i know how to do this in vbscript with ASP but not in ms access.

At the moment I have:

Code:
Dim dbs As Database, rst As Recordset, strSQL As String
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("TblRecs")

  
    If Not (rst.BOF Or rst.EOF) Then
        MsgBox "No Records Available.", vbInformation
    Else
        Do While Not rst.EOF
            cfilter = cfilter & " OR OrderID=" & rs![OrderID]
        Loop
    End If
rst.Close

But it's giving me errors.

Thanks
 
Sorry i didn't have DAO checked in my references... doh!
 
hedidit . . .

What you've shown is fine . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top