"Too few parameters"

gdanalakshmi

Registered User.
Local time
Today, 21:52
Joined
Nov 26, 2002
Messages
102
Dim CurDB As DAO.Database
Dim MoveWorksheetTB As DAO.Recordset

Set CurDB = CurrentDb()


sqlQry = "SELECT * FROM MoveWorksheets WHERE MoveRequest_ID = [Forms]![EditMoveInfo]![MoveRequest_ID]"

Set MoveWorksheetTB = CurDB.OpenRecordset(sqlQry)

With MoveWorksheetTB
.MoveFirst
While Not MoveWorksheetTB.EOF = True

[Forms]![EditMoveInfo]![ID1] = !ID

DoCmd.OpenQuery "update test voice"
Wend
.MoveNext
End With

CurDB.Close


When I run the above code, I get a error on
Set MoveWorksheetTB = CurDB.OpenRecordset(sqlQry) line "Too few parameters"

How do i fix this???
 
Try:

sqlQry = "SELECT * FROM MoveWorksheets WHERE MoveRequest_ID=" & [Forms]![EditMoveInfo]![MoveRequest_ID] & ";"
 
I encountered this problem before

Try this:

sqlQry = "SELECT * FROM MoveWorksheets WHERE MoveRequest_ID='" & [Forms]![EditMoveInfo]![MoveRequest_ID] & "';"

notes : add symbol (') before ...WHERE MoveRequest_ID= and before ;

Hope can help you.
 
You need to use the single quotes if the ID is a string. I was assuming that it was a number and therefore you don't want to include the single quotes.

If whatever was going to be there was a date then you need to surround it with # signs.
 

Users who are viewing this thread

Back
Top Bottom