I have a little problem that is driving me crazy although I am sure the answers simple
I run the following code
SQLstatement = "SELECT TblIssues.Issues, TblIssues.[record number] FROM TblIssues WHERE (((TblIssues.[record number])=[Forms]![frmEnterIssues]![txtRecordNumber]));"
Set db1 = CurrentDb
Set rcd1 = db1.OpenRecordset(SQLstatement)
and get the following error message " Runtime error 3061 , too few parameters, expected 1"
I have also run it with a variable in the where statement ie
RecordNumber = Me!txtRecordNumber
WHERE (((TblIssues.[record number])=""" & RecordNumber & """" & "));"
which gives the same error
The query runs perfectly as a query. I have also tried building the statement using the query designer switching to SQL and then copying that code ( which is identical to mine) into VBA but with the same result.
Any suggestions gratefully recieved
I run the following code
SQLstatement = "SELECT TblIssues.Issues, TblIssues.[record number] FROM TblIssues WHERE (((TblIssues.[record number])=[Forms]![frmEnterIssues]![txtRecordNumber]));"
Set db1 = CurrentDb
Set rcd1 = db1.OpenRecordset(SQLstatement)
and get the following error message " Runtime error 3061 , too few parameters, expected 1"
I have also run it with a variable in the where statement ie
RecordNumber = Me!txtRecordNumber
WHERE (((TblIssues.[record number])=""" & RecordNumber & """" & "));"
which gives the same error
The query runs perfectly as a query. I have also tried building the statement using the query designer switching to SQL and then copying that code ( which is identical to mine) into VBA but with the same result.
Any suggestions gratefully recieved