Form Event Question

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

Guest

I am trying to do something simple on a form but I keep getting an error. I
was trying to do the following: My form has 3 text boxes, textbox1,
textbox2, & textbox3, and it has a button. On clicking the button I wanted
it to add the value entered in textbox1 & textbox2 then display the answer in
textbox3. CAn someone give me the code for this?

Thanks,
Sean
 
Sean,

Private Sub MyButton_Click()

Me.Text3 = Nz(Me.Text1,0) + Nz(Me.Text2,0)

End Sub

or you could just set the control source for Text3 to
= Nz([Text1],0) + Nz([Text2],0)

HTH,
Brian
 
Back
Top