Coding problem

G

Guest

I have the below code attached to a command button called Check/Uncheck All
on a form. What I want is
[Certificate] value all records sets to = [SelectAll] value both are check
boxes.
I have this same code on other forms with text boxes and it works fine, why
will it not work on a check box.
I get an error when it gets to : Count = Counter.Value

Private Sub Check_Uncheck_All_Click()
DoCmd.GoToRecord , , acFirst
Dim Check, Count
Check = True: Count = Counter.Value
Do
Do While Count >= 1
Certificate.Value = [SelectAll].Value
Count = Count - 1
If Count = 1 Then
Check = False
Exit Do
Else
DoCmd.GoToRecord , , acNext
End If
Loop
Loop Until Check = False
End Sub

Also when the form is closed how can I get all the boxes that are checked to
revert back to unchecked. I want all the records on close to be NO.

Thanks for the help

Rodney
 
G

George Nicholson

1) What error?
2) What is Counter (and does it really have a Value property)?
 
G

Guest

Thanks
I have figured this out, I forgot this form I didn't have a counter on it.

Rodney
 

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