Filtering a Recordset
Posted on 2011-10-26
I am trying to filter a record set using the following code:
Dim RSA As DAO.Recordset
Dim RSB As DAO.Recordset
Set RSA = CurrentDb.OpenRecordset("tJDWBookings")
RSA.Filter = "jdwb_Event = me.jdwe_EventID"
Set RSB = RSA.OpenRecordset 'error on this line
jdwb_Event is an unique reference for an event which I want to filter to find bookings that match the currently displayed event. tJDWBookings is not the table that is bound to the form.
Once I have the records isolated I am going to run something like:
Do Until RSA.EOF
RSA!jdwb_Status = "CANX"
If Not RSA.EOF Then RSA.MoveNext
This will set all bookings, attached to an cancelled event, as "CANX" (cancelled).
I am getting an error message "Too few parameters. Expected 2." on the line indicated above.
Any ideas out there? I'm out for an hour or two now so don't worry if I don't reply for a while.