checkbox to update text boxes

  • Thread starter Thread starter Tammie
  • Start date Start date
T

Tammie

I would like to have several textboxes set to zero if the
checkbox is checked. Does anyone have samples on the
syntax to use in the afterupdate event?

Thank you.
 
Tammie said:
I would like to have several textboxes set to zero if the
checkbox is checked. Does anyone have samples on the
syntax to use in the afterupdate event?

Thank you.

Tammie,
In the CheckBox's AfterUpdate event AND in the Form's Current event:

If Me![CheckBoxName] = -1 Then
Me![Control1] = 0
Me![Control2] = 0
End If
 
Does the following get you going?

If Me.CheckBoxName = vbTrue Then
Me.ControlName = 0
...
ElseIf Me.CheckBoxName = vbFalse Then
...
End If
 
-----Original Message-----
I would like to have several textboxes set to zero if the
checkbox is checked. Does anyone have samples on the
syntax to use in the afterupdate event?

Thank you.
.

Hi Tammie, I'm not sure what your after but maybe the
following will help.

private sub chk_afterupdate()
if chk then
txt1.value=0
txt2.value=0
...
end if
end sub

Luck
Jonathan
 
-----Original Message-----
These solutions all work except when there is DLookup
calculation or if the textbox is being updated by value in
a combo box. It will not overrride them with zero. Do I
have to use a IIF statement for those with the DLookup or
combo statement? If so, does anyone have an example so I
can see the syntax--I keep getting errors trying to use
the IIF statement with the checkbox true/false ex:
in textbox - =IIF([checkbox157]= vbfalse,"Format
([cboposition].[Column](7)*[txtFTEBudget],"$#,##0")","0")
 
Back
Top