Function TOWARDS(CRNO As String)
Dim dbsNorthwind As DAO.Database
Dim rstEmployees As DAO.Recordset
Dim strSQL As String
Dim intI As Integer
'On Error GoTo ErrorHandler
Set dbsNorthwind = CurrentDb
' Open a recordset on all records from the Employees table that have
' a Null value in the ReportsTo field.
' strSQL = "SELECT ALLOCATION, AMOUNTs FROM [DEPARTMENT & ALLOCATION] WHERE [CR NO]= & [CRNO]"
Set rstEmployees = dbsNorthwind.OpenRecordset("SELECT [ALLOCATION], [AMOUNTs] FROM [DEPARTMENT & ALLOCATION] WHERE [CR NO]=" & [CRNO])
' Return the Recordset
TOWARDS = "DONE"
End Function
The command
Set rstEmployees = dbsNorthwind.OpenRecordset("SELECT [ALLOCATION], [AMOUNTs] FROM [DEPARTMENT & ALLOCATION] WHERE [CR NO]=" & [CRNO])
is giving Error 3061 :Too few Parameters. Expected1.
WHAT TO DO?