Clear all check boxes (1 Viewer)

rainman89

I cant find the any key..
Local time
Today, 02:07
Joined
Feb 12, 2007
Messages
3,015
ok so im trying to implement this now and am having only one record be selected.. think this is because i have a subform in datasheet view.... how do i do this for a datasheet view form?

would i do for each record set the control to true?
 

boblarson

Smeghead
Local time
Yesterday, 23:07
Joined
Jan 12, 2001
Messages
32,059
ok so im trying to implement this now and am having only one record be selected.. think this is because i have a subform in datasheet view.... how do i do this for a datasheet view form?

would i do for each record set the control to true?

The only way I've found to do this is to add a column to the table for Y/N.
 

rainman89

I cant find the any key..
Local time
Today, 02:07
Joined
Feb 12, 2007
Messages
3,015
The only way I've found to do this is to add a column to the table for Y/N.

i have one.. its just a check box for every record.... just wanna know how i would change them all to yes
 

boblarson

Smeghead
Local time
Yesterday, 23:07
Joined
Jan 12, 2001
Messages
32,059
Use an update query and call it from your code.
 

rainman89

I cant find the any key..
Local time
Today, 02:07
Joined
Feb 12, 2007
Messages
3,015
That was gonna be my initial approach, but i thought using recordsets like above would work. thanks boB
 

WinDancer

Registered User.
Local time
Yesterday, 23:07
Joined
Oct 29, 2004
Messages
290
I know this is an old thread but is is exactly what I am trying to do, using Access 2007.
I used Bob's code [changed the False to No] bit it only clears one checkbox on the form and doesn't change any others???
Here is the code...

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
'Clear all checkboxes

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
ctl.Value = No
End If
Next ctl

'Me![Include?] = No

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
MsgBox err.Description
Resume Exit_Command7_Click

End Sub

Any thoughts?
Thanks,
Dave
 

Users who are viewing this thread

Top Bottom