Clearing Checkboxes?

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hello,
I have a form that lets users select envelopes to print with a check box. I
want to be able to clear the boxes by clicking a button. I'm using the
following code in the on click event, but it only clears the last check box
and not all of them. Does anyone know what I'm doing wrong?

Private Sub Command22_Click()
Me.[Print] = Null

End Sub

Thanks
Jim
 
Is the Print field in the form's detail section and bound to a record or is
it in one of the Header/Footer sections?
 
The print button is in the Footer section and I use a query to only print
the records with a true value in the check box.

Barry Gilbert said:
Is the Print field in the form's detail section and bound to a record or
is
it in one of the Header/Footer sections?

Jim said:
Hello,
I have a form that lets users select envelopes to print with a check box.
I
want to be able to clear the boxes by clicking a button. I'm using the
following code in the on click event, but it only clears the last check
box
and not all of them. Does anyone know what I'm doing wrong?

Private Sub Command22_Click()
Me.[Print] = Null

End Sub

Thanks
Jim
 
When you say Me.[Print]=Null, it will only point to the selected record. To
deselect the checkboxes for all the records, you'll need to do a loop.
Something like this:

Me.Recordset.MoveFirst
Do Until Me.Recordset.EOF
Me.[Print]=Null
Me.Recordset.MoveNext
Loop

Barry

Jim said:
The print button is in the Footer section and I use a query to only print
the records with a true value in the check box.

Barry Gilbert said:
Is the Print field in the form's detail section and bound to a record or
is
it in one of the Header/Footer sections?

Jim said:
Hello,
I have a form that lets users select envelopes to print with a check box.
I
want to be able to clear the boxes by clicking a button. I'm using the
following code in the on click event, but it only clears the last check
box
and not all of them. Does anyone know what I'm doing wrong?

Private Sub Command22_Click()
Me.[Print] = Null

End Sub

Thanks
Jim
 
Thanks, that worked great!

Jim

Barry Gilbert said:
When you say Me.[Print]=Null, it will only point to the selected record.
To
deselect the checkboxes for all the records, you'll need to do a loop.
Something like this:

Me.Recordset.MoveFirst
Do Until Me.Recordset.EOF
Me.[Print]=Null
Me.Recordset.MoveNext
Loop

Barry

Jim said:
The print button is in the Footer section and I use a query to only print
the records with a true value in the check box.

Barry Gilbert said:
Is the Print field in the form's detail section and bound to a record
or
is
it in one of the Header/Footer sections?

:

Hello,
I have a form that lets users select envelopes to print with a check
box.
I
want to be able to clear the boxes by clicking a button. I'm using the
following code in the on click event, but it only clears the last
check
box
and not all of them. Does anyone know what I'm doing wrong?

Private Sub Command22_Click()
Me.[Print] = Null

End Sub

Thanks
Jim
 

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

Back
Top