Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    5

    Question Unanswered: Inventory with MS Access 2007/2010

    Friends,

    I am not a database guru and need your help.

    I created a database with 2 tables and 1 query: tblPayment,tblEmployee,gryCalculation

    tblPayment is updated twice in a month. every payment has his own paymentID.

    I have a calculated field "ontv"(total workedhours)
    I have a vacationfactor
    For paymentX the employee gets (ont*vacationfactor) this field is called "per"
    eg: 50*0.056= 2.8

    I have a field in tblEmployee called vacationsaldo.

    Every payment an Employee can use their vactionsaldo


    What i want is:

    On every payment the field: vacationsaldo must be: vacationsaldo + per.
    If in tblPayment the field: VacationOP has a value it must be subtracted of the field vacationsaldo.

    Something like this: vacationsaldo + per - VacationOP

    After this formula the field vacationsaldo is uptodate.

    For 1 payment it works great but what to do if the table is updated twice a month?

    Eg:After payment 12 this formula is used, if i enter payment 13 this formula must be used on the up to date vacationsaldo value.

    Please help?
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2010
    Posts
    5
    Need more invormation?

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Unless I'm missing something, you're doing it correctly. Since the tblEmployee field vacationsaldo is storing the correct numbr AFTER the completed payment has been calculated, each time you attempt a payment, simply use that figure for the current calculations.

    Is something happening to the vacationsaldo from the time you calculate it until the time you store it in tblEmployee?

    SL

  4. #4
    Join Date
    Jul 2010
    Posts
    5

    Question

    thnx for your reply.

    Nothing changed when the calculation happend. The vacationsaldo continued with the same value.

    Do you think i should use a update query? Any other idea how to solve this

  5. #5
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    I don't understand what's not working. If it works with one payment, why shouldn't it work with multiple payments?

    SL

  6. #6
    Join Date
    Jul 2010
    Posts
    5
    The [vacationsaldo] field is not being updated by the calculation.
    Field [vacationsaldo] must be updated by 2 calculations:
    1.[Vacationsaldo]+ont*vacationfactor
    2.[vacationsaldo]-VacationOP

Posting Permissions

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