Hi all,
I have a query which I want to pull all records from a table, where one field is equal to the value inputted by the user on a form.
To do this, I have a simple select query, "ToolCharacteristics", from the table, and I want to match the assembly number with that from the "Assembly Number" field on the form "Bill of Materials". To accomplish this, in the criteria field of Assembly Number in the query, i have: [Forms]![Bill of Materials]![Assembly Number]. There are no other criteria
Now when the next form loads, I want to run the query and count the rows, but when it tries to open the query, I get a message saying, "Too few Parameters. Expected 1."
Here is the code I have to open the query.
Private Sub Form_Load()
Dim rst as Recordset, QCount as Integer
Set rst = Application.CurrentDb.OpenRecordset("ToolCharacteristics"
- This is where the error occurs
QCount = rst.RecordCount
.
.
.
If anyone can offer any help, I would greatly appreciate it.
Thanks,
Jeff
I have a query which I want to pull all records from a table, where one field is equal to the value inputted by the user on a form.
To do this, I have a simple select query, "ToolCharacteristics", from the table, and I want to match the assembly number with that from the "Assembly Number" field on the form "Bill of Materials". To accomplish this, in the criteria field of Assembly Number in the query, i have: [Forms]![Bill of Materials]![Assembly Number]. There are no other criteria
Now when the next form loads, I want to run the query and count the rows, but when it tries to open the query, I get a message saying, "Too few Parameters. Expected 1."
Here is the code I have to open the query.
Private Sub Form_Load()
Dim rst as Recordset, QCount as Integer
Set rst = Application.CurrentDb.OpenRecordset("ToolCharacteristics"
QCount = rst.RecordCount
.
.
.
If anyone can offer any help, I would greatly appreciate it.
Thanks,
Jeff