edisonl via AccessMonster.com said:
Hi,
any idea how can I explicitly set all Boolean Datatype within a form to
FALSE
with a On_Click Button ?
Put this in a standard module named basUtilities or something:
Public Sub CheckIt(frm As Form)
Dim ctl As Control
For Each ctl In frm.Controls
If ctl.Controltype = acCheckBox
ctl.Value = False
End If
Next ctl
Set ctl = Nothing
Set frm = Nothing
End Sub
Then call it from a command button:
Private Sub cmdWhatever_Click()
Call CheckIt(Me)
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
Disclaimer: Any code or opinions are offered here as is. Some of that
code has been well tested for number of years. Some of it is untested
"aircode" typed directly into the post. Some may be code from other
authors. Some of the products recommended have been purchased and
used by the author. Others have been furnished by their manufacturers.
Still others have not been personally tested, but have been
recommended by others whom this author respects.