Help with checking all Checkboxes using recordset

gdomino

New member
Local time
Today, 10:00
Joined
Apr 1, 2003
Messages
8
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
 
Try:

Set rs = CurrentDb.OpenRecordset("select * from tblPollination where Ptpl_pollination_date_1 = #" & dt & "#")

hth,
Jack
 
Thanks Jack

Thank you. I should of seen that. But now it doesn't do anything. None of the boxes change. I'm sorry to ask but could you help me figure out what is wrong. I work for a plant breeding department in a seed company. The project we are doing has started generating over 200 plants a week. We need a way to track and record info on them. I was hired as a greenhouse assistant. I have a degree in MIS but haven't been able to find a job yet. The IT dept told my dept head they didn't have the time to work on this so he told me if I wanted to do it I could. So I am working 8 to 10 hours a day and trying to get this database, bar coding app and pda scanner apps done. (about another 4 to 6 hours a day) Haven't really talked to my wife for a week. My brains a little mushy right now. I should take a break for a day but my boss is so thrilled with what I've done so far I keep thinking I'll disappiont him. So any help would be appreciated.
 
Rich, as always, has seen the forest for the trees. A simple update query should do nicely....

Good luck with the project and if you need additional help just let us know as that is what we are here for.

Jack
 

Users who are viewing this thread

Back
Top Bottom