Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Posts
    1

    Unanswered: Help with Math Calculations between Fields

    Hey guys, im new to this forum so any help/ideas would be great.

    I am writing a db to track pipe quantities throughout my plant. i have a form that enters all of the job information into the master table TBLHEADER,

    Fields:
    Job #
    Expected In
    On Hand
    Remaining expected

    what i would like to do is be able to enter in "Expected In" and "On Hand" in manually and would like a seperate field to show on that same form after the "on Hand" data is entered "Remaining expected" which would be "Expected In"-"On Hand".

    Also i would like to be able to call up that "Job #" record in the future and ship the same product, which would just move a specific qty "QTY TO SHIP" from the On hand Total.

    Any ideas

    I just cant see what i am missing.

    Thanks so much in advance. Email me at n19bmw@yahoo.com with any ideas


  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by n19bmw
    what i would like to do is be able to enter in "Expected In" and "On Hand" in manually and would like a seperate field to show on that same form after the "on Hand" data is entered "Remaining expected" which would be "Expected In"-"On Hand".
    In the AfterUpdate event of your two boxes, call a sub (this was it doesn't matter if you enter box1 first or box2 first). In that sub, check to see that both boxes have numbers in them, and if they do, assign the difference to box3. Something like below:
    Code:
    Private Sub Box1_AfterUpdate()
    
    Call AutoFillRemaining
    
    End Sub
    
    
    Private Sub Box2_AfterUpdate()
    
    Call AutoFillRemaining
    
    End Sub
    
    Private Sub AutoFillRemaining()
    
    If Not Me.box1 = Null Or Not Me.box2 = Null Then
        Me.box3 = Me.box1 - Me.box2
    End If
    
    End Sub
    Quote Originally Posted by n19bmw
    I just cant see what i am missing.
    What do you have so far?

    Quote Originally Posted by n19bmw
    Email me at n19bmw@yahoo.com with any ideas
    Now that would defeat the purpose of a public forum now wouldn't it?
    Me.Geek = True

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •