Consulting

Results 1 to 4 of 4

Thread: BeforeUpdate Event Problems

  1. #1
    VBAX Newbie
    Joined
    Aug 2005
    Posts
    5
    Location

    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

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Wouldn't you be better off having the calculation in a separate text box that the user cannot change?

  3. #3
    VBAX Newbie
    Joined
    Aug 2005
    Posts
    5
    Location
    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

  4. #4
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    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
  •