Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Marking several checkboxes = true simultaneously 1

Status
Not open for further replies.

litlTee

Technical User
Apr 6, 2005
2
US
I have a browser main form and a continuous subform. My subform has a check box signifying if the item has been approved. After I have queried my subform, I would like to have a command button on my main form that would mark all checkboxes = true instead of clicking each one separately.
I have seen this before, but can't seem to make it work for me. Thanks
 
How are ya litlTee . . . . .

Try this in the [blue]Click event[/blue] of the button ([blue]you![/blue] substitute proper names in [purple]purple[/purple]):
Code:
[blue]   Dim rst As DAO.Recordset
   
   Set rst = Me.RecordsetClone
   
   If Not rst.BOF Then
      Do
         rst.Edit
         rst![purple][b]CheckBoxName[/b][/purple] = True
         rst.Update
         rst.MoveNext
      Loop Until rst.BOF
   End If
   
   Set rst = Nothing[/blue]

Calvin.gif
See Ya! . . . . . .
 
Dim TheForm As Form
Dim ObjChk As Control

Set TheForm = Screen.ActiveForm
For Each ObjChk In TheForm.Controls
'106 for checkbox
If ObjChk.ControlType = 106 Then
ObjChk.Value = 1
End If
Next ObjChk

I hope that will work (it's working for me)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top