how do i reset all the values to 0 in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an invoice form that I want to be able to reset the input values but
keep the name and ssn fields intact. I know this is a very simple thing to
do but I have been away from access for 6 years and now I need help.
thanks
 
Hi,
The undo method will undo all changes on the form, so that might not work.
You could probably loop through the controls and use the tag property of the
two controls you do not want to reset. This is some sample code:

Dim ctl As Control

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox And ctl.Tag <> "No" Then
ctl.value = null
End If
Next ctl

put "No" (without quotes) in the tag property of the two controls you want
to leave out.
HTH
Good luck
 
Assuming you are going to make a new record for the same person, set the
Default Value property to 0 for all the numeric controls you want to set to 0.

Then, when you want to create a new record for the same person, assign the
values for those controls to varialbes, go to a new record, and assign the
controls the values you saved in th varialbes.
 
Back
Top