How to update a field value based on the condition of a check box?

G

Guest

I have a checkbox field, and a number field. If a person puts a check in the
check box then I want the value of the number field to immediately be set to
0.5. If they do not check the box I need the value to be 0.

I need this to occur immediately (and hopefully invisibly) at the time of
the checkbox field update, or I would settle for the value of the number
field being updated at the end of the record input.

Thanks
 
S

Svetlana

First you could put the defaultvalue property for the number field to
0. Then on after update even of your checkbox you can arrange the value
of your number field as like.

Private Sub MyCheckBox_AfterUpdate()
If Me.MyCheckBox=True Then
Me.NameOFNumberField=0.5
Else
Me.NameOFNumberField=0
End If
End Sub
 
G

Guest

hi Try this......

Private Sub on_Click()
If CheckBoxName.Value = True Then
FeildName.Value = 1800 '(whatever value you want to
enter)'
ElseIf CheckBoxName.Value = False Then
FeildName.Value = 0
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top