-
BeforeUpdate Event Problems
I have a text box that the user enters a number in. It pulls the price from another table and updates the variable "charge" and shows the updated price in a textbox on the form.
problem is when the user creates a new record and puts a number in the textbox, it erases the charge from the textbox that displays the updated charge.
here is the code
[VBA]Private Sub numEdu_BeforeUpdate(Cancel As Integer)
intSubscript = selectCustomer.ListIndex
charge = charge - (Me.numEdu.OldValue * m_educ(intSubscript))
End Sub[/VBA]
numEdu is assigned to the input textbox
-
Wouldn't you be better off having the calculation in a separate text box that the user cannot change?
-
the user has to enter a number in the text box for the new record, and when they do before the new record is saved, it erases the variable charge
now if a new record is entered and saved, the user can go back and enter the number for the variable numEdu and it will update the variable charge
i need it to update charge before the record is saved for a new record with out erasing charge
-
Salating,
Welcome to VBAX!
I'm sure if you provided a tiny sample for us, we could get you fixed right quick!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules