Form Event Question

S

Sean

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
 
B

Brian Bastl

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
 

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