Set fields back to default

A

Alex

I have the following code in a button on my form that I use to set the
contents of the fields, BT, BT1, BT2, BT3 to null. I have since given these
fields a default value of 0 (zero) in the underlying table. Now I need the
button, when clicked, to set the fields back to 0. When I use Me.BT = 0,
they are still set to null. Can you please tell me how to set the fields to
0? Thanks much!

Private Sub ClearBreakthrough_Click()
Me.BT = Null
Me.BT1 = Null
Me.BT2 = Nul
Me.BT3 = Null
End Sub
 
W

Wayne Morgan

The Default Value will only work when you go to a new record. Is that what
you're wanting? Are you wanting the fields set to zero for the current
record or all records?
 
A

Alex

Thanks Wayne. It's only some of the fields on the current record that I want
set to the defaults. Thanks for you help.
 
W

Wayne Morgan

Is the button on the same form as the textboxes? If so, then substituting 0
for Null in your current code should set them to 0 unless you have other
code running that changes them to something else.
 
A

Alex

Geesh - that is the first thing I tried, before I posted and it didn't work.
Today, however, it worked perfectly. I must have been doing something wrong.
Thank you for your time Wayne.
 
Top