Larry DeLarvelle is looking at this with me, but I wanted to see of anyone else had any ideas. Can someone tell me why I get an error "too few parameters. Expected 2." at the Set rsTemp = dbTemp.OpenRecordset(strSQL) line in the following code? My field types are as follows:
Rev_Pub_Date is a date field
Proc_ID is numerical
CurrentCk is a checkbox (Yes/No)
Here's the code:
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset
Dim strSQL As String
Set dbTemp = CurrentDb
strSQL = "SELECT Rev_Pub_Date, CurrentCk FROM T_Dates " & _
"WHERE (((T_Dates.Proc_ID)=" & Me.Proc_ID & "
" & _
"AND ((T_Dates.CurrentCk)=-1)) ORDER BY Rev_Pub_Date"
Set rsTemp = dbTemp.OpenRecordset(strSQL)
If rsTemp.RecordCount > 0 Then
rsTemp.MoveFirst
rsTemp.MoveNext
Do Until rs.Temp.EOF
With rsTemp
.Edit
!CurrentCk = 0
.Update
End With
rsTemp.MoveNext
Loop
End If
rsTemp.Close
Rev_Pub_Date is a date field
Proc_ID is numerical
CurrentCk is a checkbox (Yes/No)
Here's the code:
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset
Dim strSQL As String
Set dbTemp = CurrentDb
strSQL = "SELECT Rev_Pub_Date, CurrentCk FROM T_Dates " & _
"WHERE (((T_Dates.Proc_ID)=" & Me.Proc_ID & "
"AND ((T_Dates.CurrentCk)=-1)) ORDER BY Rev_Pub_Date"
Set rsTemp = dbTemp.OpenRecordset(strSQL)
If rsTemp.RecordCount > 0 Then
rsTemp.MoveFirst
rsTemp.MoveNext
Do Until rs.Temp.EOF
With rsTemp
.Edit
!CurrentCk = 0
.Update
End With
rsTemp.MoveNext
Loop
End If
rsTemp.Close