Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Apr 2004
    Posts
    29

    Unanswered: Results + Savings

    I have a field in a form to calculate taxes. To get the results intended I have inserted a formula in the "Control Source" of the filed. It gives me the results right away upon entering any product or service price, but it doesn't save the results. Meaning that if I'm working in the form, I can see all prices, but if I go to the table, no taxes.

    I just want to know if I can add something to the formula so it saves the results as it displays them without having to add and extra field in the form.

    Thank you!

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Question Re: Results + Savings

    Originally posted by brduran
    I have a field in a form to calculate taxes. To get the results intended I have inserted a formula in the "Control Source" of the filed. It gives me the results right away upon entering any product or service price, but it doesn't save the results. Meaning that if I'm working in the form, I can see all prices, but if I go to the table, no taxes.

    I just want to know if I can add something to the formula so it saves the results as it displays them without having to add and extra field in the form.

    Thank you!
    Generally, it it is not considered good practice to store calculated values in the tables. There are many exceptions to this but in your case, you can probably derive the amounts you want in any query, report or form.

    Is there a particular reason that you want the value stored?
    Gregg


    DAO, ADO, SQL, Automation and anything else I can pick up.

  3. #3
    Join Date
    Apr 2004
    Posts
    29

    Re: Results + Savings

    Originally posted by basicmek
    Generally, it it is not considered good practice to store calculated values in the tables.
    I hear you.

    Originally posted by basicmek
    Is there a particular reason that you want the value stored?
    Prior to creating the form from a table, I inserted all the columns needed in the table, including "Taxes". So I just went to the table itself, and almost had a heart attack when I noticed that the "Taxes" column had $0.00 from top to bottom. Then I realized that "Taxes" is calculaled dinamically. It occurred to me that if ever needed I should be able to get the number straight from the table, without relying so much on the form.

    Thank you!

  4. #4
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    Bind the taxes text box to the field in your table. In the after_update event of the price textbox, place
    "taxes"=insert_formula

  5. #5
    Join Date
    Apr 2004
    Posts
    29
    Originally posted by Saila
    Bind the taxes text box to the field in your table. In the after_update event of the price textbox, place
    "taxes"=insert_formula
    I think you're onto something, it sounds logical. But the textbox name "Taxes" exist in both the Form and the Table, so how would the software know that you're talking about updating the table field and not the form.

    The table's name is MAIN_TABLE, the form is MAIN_FORM, and the field TAXES is in both MAIN_TABLE and MAIN_FORM.


    Thank you!

  6. #6
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    It doesn't matter, because by updating the one you are automatically updating the other. That is why they are given the same name.

  7. #7
    Join Date
    Apr 2004
    Posts
    29
    Originally posted by Saila
    It doesn't matter, because by updating the one you are automatically updating the other. That is why they are given the same name.
    "taxes"=formula_inserted

    ...is not happening. Any ideas? Thank you!

  8. #8
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    could you post the formula that you are using as a control source, and the name of your sales text box/boxes, and the name of your taxes text box

  9. #9
    Join Date
    Apr 2004
    Posts
    29
    Originally posted by Saila
    could you post the formula that you are using as a control source, and the name of your sales text box/boxes, and the name of your taxes text box
    Control Source =([HARD_PRICE_1]+[HARD_PRICE_2]+[HARD_PRICE_3]+[HARD_PRICE_4]+[SOFT_PRICE_1]+[SOFT_PRICE_2]+[SOFT_PRICE_3]+[SOFT_PRICE_4])*0.075

    The name of the taxes textbox is PROD_PST

    Thank you!

  10. #10
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    Try :

    PROD_PST = ([HARD_PRICE_1]+[HARD_PRICE_2]+[HARD_PRICE_3]+[HARD_PRICE_4]+[SOFT_PRICE_1]+[SOFT_PRICE_2]+[SOFT_PRICE_3]+[SOFT_PRICE_4])*0.075

    Put it in the form_current event.

    Should work, let me know if it doesn't...

  11. #11
    Join Date
    Apr 2004
    Posts
    29
    Originally posted by Saila
    Try :

    PROD_PST = ([HARD_PRICE_1]+[HARD_PRICE_2]+[HARD_PRICE_3]+[HARD_PRICE_4]+[SOFT_PRICE_1]+[SOFT_PRICE_2]+[SOFT_PRICE_3]+[SOFT_PRICE_4])*0.075

    Put it in the form_current event.

    Should work, let me know if it doesn't...
    I put it in After Update, and nothing. We've got to be close to what works.

    Thank you!

  12. #12
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    Did you put in form_current?
    The after_update only occurs after the field is edited.
    So it would be better to put it into the form_current event.

  13. #13
    Join Date
    Apr 2004
    Posts
    29
    Originally posted by Saila
    Did you put in form_current?
    The after_update only occurs after the field is edited.
    So it would be better to put it into the form_current event.
    This is the Event window. There's no form_current event, unless I'm supposed to looking someplace else.

    Thank you!
    Attached Thumbnails Attached Thumbnails events.gif  

  14. #14
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    sorry, the form_current event is for the form, not the text box:
    Attached Thumbnails Attached Thumbnails form_current.jpg  

  15. #15
    Join Date
    Apr 2004
    Posts
    29
    The dot in 0.075 is not sitting well with what we want to do "The . (dot) operator usually indicates that what follows is an item defined by Microsoft Access." - a quote straight from 'help'

    PROD_PST = ([HARD_PRICE_1]+[HARD_PRICE_2]+[HARD_PRICE_3]+[HARD_PRICE_4]+[SOFT_PRICE_1]+[SOFT_PRICE_2]+[SOFT_PRI
    CE_3]+[SOFT_PRICE_4])*0.075

    Any work around? Thank you!

Posting Permissions

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