Too Few Paremeters - Error 3061

L

LisaB

When I run the following code I get and error 3061 'Too few parameters.
Expected 1.' The code stops on the line stared below. How can I fix it?

----------------------------------
Public Sub GetSOWNumber(Project As String)

SQLStatement = "SELECT tblSWONumber.* FROM tblSWONumber " _
& "WHERE (((tblSWONumber.Project)=" & Project & "));"

Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset(SQLStatement, dbOpenDynaset,
dbSeeChanges) '*Error code stops here*

SOWNumber = SourceRS![SOWNum]
With SourceRS
.Edit
!SOWNum = SOWNumber + 1
!NDate = Date
.Update
.Bookmark = .LastModified
End With


SourceRS.Close
End Sub
----------------------------------------------------
 
G

Guest

If your field Project is a string, try:

SQLStatement = "SELECT tblSWONumber.* FROM tblSWONumber " _
& "WHERE (((tblSWONumber.Project)='" & Project & "'));"

Just a single quote (') after the equal (=) sign and another single quote in
'));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top