GaelicFatboy
Registered User.
- Local time
- Today, 22:43
- Joined
- Apr 17, 2007
- Messages
- 100
I'm running into a bit of a problem when trying to open a recordset for a query. What I've got is a query referring to all fields in a single table with two filter criteria producing a single record from the tables data. The code I'm using is as follows:
Set My_DataBase = CurrentDb
Set My_RecordSet = My_DataBase.OpenRecordSet("My_Query", dbOpenDynaset) 'the code generates an error here
With My_RecordSet
.FindFirst "Category=""" & Combo_Category & """"
If Not .NoMatch Then
.Edit
![Discount] = Me.Text_Discount
.Update
.Close
End if
End With
What's going wrong is the second line of code produces an error as follows:
Error:3061, Too few parameters, expected 2.
The two filter criteria are for 'AccountNumber' and 'Category', with the two remaining fields being 'Discount' and DiscountType'.
I'm guessing the error has something to do with the two filter criteria, but I've tried a few variations without success.
Is anyone able to shed some light?
Cheers
D
Set My_DataBase = CurrentDb
Set My_RecordSet = My_DataBase.OpenRecordSet("My_Query", dbOpenDynaset) 'the code generates an error here
With My_RecordSet
.FindFirst "Category=""" & Combo_Category & """"
If Not .NoMatch Then
.Edit
![Discount] = Me.Text_Discount
.Update
.Close
End if
End With
What's going wrong is the second line of code produces an error as follows:
Error:3061, Too few parameters, expected 2.
The two filter criteria are for 'AccountNumber' and 'Category', with the two remaining fields being 'Discount' and DiscountType'.
I'm guessing the error has something to do with the two filter criteria, but I've tried a few variations without success.
Is anyone able to shed some light?
Cheers
D