I have a form with a subform presenting datasheet view. The purpose of the form is to view records that will be printed based on the date. I have a text box on the main form that displays the current date and determines which records are visible in subform. If all the records look ok then a button is press to print the labels and the checkboxes associated with each record are "supposed" to then be checked. The check box determines whether a record has been printed. If the checkbox is checked then the record doesn't show up again if additional labels for that day need to be printed.
I keep getting the error message "no current record".
I would appreciate any help.
Dim dt As Date
Dim rs As DAO.Recordset
dt = TxtDate
Set rs = CurrentDb.OpenRecordset("select * from tblPollination where Ptpl_pollination_date_1 = " & dt & " ")
rs.MoveFirst
Do While Not rs.EOF
If rs![Printed] = 0 Then
rs.Edit
rs![Printed] = -1
rs.Update
End If
rs.MoveNext
Loop
rs.Close
I keep getting the error message "no current record".
I would appreciate any help.
Dim dt As Date
Dim rs As DAO.Recordset
dt = TxtDate
Set rs = CurrentDb.OpenRecordset("select * from tblPollination where Ptpl_pollination_date_1 = " & dt & " ")
rs.MoveFirst
Do While Not rs.EOF
If rs![Printed] = 0 Then
rs.Edit
rs![Printed] = -1
rs.Update
End If
rs.MoveNext
Loop
rs.Close