Help with code to run query and test a field in the record

From: Kate (anonymous_at_discussions.microsoft.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 15:13:00 -0700

Tried the following and get the message too few parameters
expected 3. The following statement gets highlighted:

Set rs = db.OpenRecordset("QueryAv")

Any idea? Thanks

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb()
Set rs = db.OpenRecordset("QueryAv")

If rs![Booking ID] = 1 Then
   DoCmd.OpenForm "SINGLE BOOKING DETAIL"
End If

rs.Close : Set rs = Nothing
Set db = Nothing

>MVP [MS Access]