Check all

S

Stacey

Does anyone know how to check all check boxes with the click of one check
box, this is on a continuous form and will append the table on a global
scale. Thanks in advance.
 
R

ruralguy via AccessMonster.com

Assuming the CheckBoxes are bound to a field in the RecordSource for the
continuous form then an update query would be my tool of choice.
 
S

Stacey

Ok, I have

Private Sub Command22_Click()
Me.Oustanding = 0

End Sub

But how do you get it to go to the next record and stop at the end of the
record set?
 
S

SteveM

Stacey, as RuralGuy mentioned, you need to use an Update Query...

If you want to set all check box fields (Yes/No) to True in a table then try
something like this in your Click event:

Dim strSQL As String
strSQL = "UPDATE myTable SET myField = " & True

CurrentDb.Execute strSQL, dbFailOnError

Change myTable and myField to the name of the respective table and field name.

Steve
 
R

ruralguy via AccessMonster.com

Steve has given you the code for the update query but you will need to
requery so your form will pick up the changes.
 
S

Stacey

ok this is what I have..

Private Sub Command22_Click()
Dim strSQL As String
strSQL = "UPDATE Forecastnames SET Oustanding = " & -1
CurrentDb.Execute strSQL, dbFailOnError
End Sub

one problem....why does the form not update (only the first checkbox) until
I close and reopen the form?
 

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