too few parameters error in vba

Toeying

Registered User.
Local time
Today, 14:19
Joined
Jul 30, 2010
Messages
79
Hello All,
I am trying to run this code:

Dim strIn As String
Dim rst As DAO.Recordset
Dim strSQL As String

Set rst = Me.RecordsetClone

Do Until rst.EOF
strIn = strIn & rst!ChildHSReferenceNumber & ","
rst.MoveNext
Loop

If Right(strIn, 1) = "," Then
strIn = Left(strIn, Len(strIn) - 1)
End If

strSQL = "Update HSChild Set HSChildOver6Month = 'Yes' "
strSQL = strSQL & "WHERE ChildHSReferenceNumber IN(" & strIn & ")"

CurrentDb.Execute strSQL

rst.Close
Set rst = Nothing


but I keep getting an error messages: too few parameters? what can be going wrong? many thanks for your helps...
Ty
 
If HSChildOver6Month is a boolean field in your table then:

....
strSQL = "Update HSChild Set HSChildOver6Month = True "
...


JR
 

Users who are viewing this thread

Back
Top Bottom