Select All Button

B

BZeyger

I currently have a VBA app that has users select which records they would
like to process. When the information populates in the form, they would have
to manualy check off all the desired records.

How can I have a button automatically but a check box in the of the records.
The form get processed if the Run option is selected in the record.

Form Name: Main_form
Subform Name: info_subform
data field: run (it is a YES/NO type)
field name: chkrun

I would like the button cmdCheckAll to place a check in all the records. The
same would work for uncheck.
 
J

John Spencer

IF you wanted to set the field in all the records in the table then you
can use an update query.

To clear all the records you could use
UPDATE SomeTable
SET SomeTable.SomeField = False
WHERE SomeTable.SomeField = True

To set all the records change False to True and True to False



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
D

Dirk Goldgar

John Spencer said:
IF you wanted to set the field in all the records in the table then you
can use an update query.

To clear all the records you could use
UPDATE SomeTable
SET SomeTable.SomeField = False
WHERE SomeTable.SomeField = True

To set all the records change False to True and True to False


But this is on a subform, right? So the update query would want to apply an
addition criterion to only update those records that are related to the
current main-form record.
 

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