Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add it to a value in a table from a form's textbox

Status
Not open for further replies.

tayse

Technical User
Jan 10, 2006
9
CA
Hi,

How can I add a value from a form to a value in a table.

There is already a value in the table, whatever I type to textbox is going to be added to the value in that table, and at the same time it will be deducted from another table.

Thank you for your reply.
 
Place and unbound field on the form. I called it TextOne. I had a field called intBase. This works but you better do some error checking. I used the val function to handle letters, but this is a little sloppy.
Code:
Private Sub Form_Current()
  TextOne = 0
End Sub
Private Sub TextOne_AfterUpdate()
  If Not IsNull(TextOne) Then
    Me.intBase = Me.intBase + Val(TextOne)
  End If
End Sub
[code]
Now you said the subtracting is from a value in another table. If it is not part of the recordsource that is a more difficult problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top