Clear All Check Boxes on Form

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi All,

Is there a way to clear all Check boxes on a form without having to call out
each one and set it to Null or False?

Thanks
Matt
 
S

strive4peace

Hi Matt,

here is a function you can put into a general module:

'~~~~~~~~~~~~~~~~~~~
Function Form_ClearControlsChk(pF As Form) as boolean
ClearControlsChk = false
Dim ctl As Control
On Error Resume Next
For Each ctl In pF.Controls
If ctl.ControlType = acCheckBox Then ctl.Value = False
Next ctl
ClearControlsChk = true
End Function
'~~~~~~~~~~~~~~~~~

to call it, put this Statement in the code behind the form:

ClearControlsChk Me



Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Top