Select All Check Boxes Help

R

rap43

I am using a multi select form to select events to create a weekly report. I
use a start date and end query to populate the form. The form has a check box
that is will be available for each event. Once the selections are marked and
the report is created, I have a toggle button that will clear all check boxes
and reset the button. I use Set colCheckBox = Nothing and Toggle = False. I
need another toggle button that will select all. Can someone give me a little
advice?
 
W

Wayne-I-M

Hi

Of course I can't see your DB in action so I don't know what kind of weekly
report you are cratein but it would seem to me that simply resetting all the
options is not the way forward. Of course you could save the details to a
table and then re-set the option but it would be simpler to just go to a new
record - I am assuming that this is a bound form.

If you re-set / over write the data you will not be able to give a date
based report - ie, for the year, quarter, month etc. I would suggest that
you may want to look at making the default setting of the options null and
the toggles false. Then, it you have a go to new record button you would get
the results you want and also not lose the stored data by over writing the
table record. If you form is "not" bound to a table - it should be.

Hope this helps
 
R

rap43

Thank Wayne

I guess I need explain more clearly, once I have selected records from the
list with a check box for each record. I have a command button that launches
the report with the records selected with the check box. I then print that
report and close the report; I click a command button to clears the check
boxes in the form. I now have the same records in the form; I may need a
report printed with all record in the list. There maybe 40 records in the
list of events for next week, rather than have to click in each check box I
like a command button that populates all.

I use the code below to clear the check boxes now and I need a command to
select all.
Set colCheckBox = Nothing (his clears the check boxes)
Toggle = False. (his toggle the toggle button to its up state)

What will populate the check boxes?
 
P

pietlinden

rap43 said:
Thank Wayne

I guess I need explain more clearly, once I have selected records from the
list with a check box for each record. I have a command button that launches
the report with the records selected with the check box. I then print that
report and close the report; I click a command button to clears the check
boxes in the form. I now have the same records in the form; I may need a
report printed with all record in the list. There maybe 40 records in the
list of events for next week, rather than have to click in each check box I
like a command button that populates all.

I use the code below to clear the check boxes now and I need a command to
select all.
Set colCheckBox = Nothing (his clears the check boxes)
Toggle = False. (his toggle the toggle button to its up state)

What will populate the check boxes?

Strictly my opinion, but...
I would use a multi-select listbox instead of all the checkboxes,
because then you can process them all as a group and de/select items
as you wish. There's code at AccessWeb that tells you how to use a
multi-select LB to limit query/report results, so... www.mvps.org... I
think it's in the forms section...

Private Sub cmdSelectAll_Click()
'Selects all values in a multi-select listbox
Dim intCurrentRow As Integer
For intCurrentRow = 0 To Me.List0.ListCount - 1
Me.List0.Selected(intCurrentRow) = True
Next intCurrentRow

End Sub


Private Sub cmdDeSelectAll_Click()
'DE-selects all values in a multi-select listbox

Dim intCurrentRow As Integer

For intCurrentRow = 0 To Me.List0.ListCount - 1
Me.List0.Selected(intCurrentRow) = False
Next intCurrentRow

End Sub
 
U

UpRider

Rap, if your checkboxes are in a frame you can use this example in the frame
event or to a command button click event:
Each time you click, it will reverse the settings in the checkboxes

Private Sub grpINTERESTS_DblClick(Cancel As Integer)
chkROAD = Not chkROAD
chkOFFROAD = Not chkOFFROAD
chkFUN = Not chkFUN
chkSOCIAL = Not chkSOCIAL
chkADVOCACY = Not chkADVOCACY
chkCOMMUTER = Not chkCOMMUTER
chkSENIOR = Not chkSENIOR
chkTOURING = Not chkTOURING
End Sub

UpRider
 

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

Top