1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Expression in access 2007

Discussion in 'Business Applications' started by WilliamE, Nov 1, 2007.

Thread Status:
Not open for further replies.
  1. WilliamE

    WilliamE Thread Starter

    Nov 1, 2007
    HELPPPP! LOL I'm trying to build an expression in Access. Here's my situation. I have a report that displays some fields. One named "Work Code", simple text field. It get it's value from a seperate table. On that table it is a drop down list that has all text values.

    Another field, named "Billing Rate" also gets it's value from a seperate table. It is just plain text containing a currency value. i.e. $20.00

    First it needs to get the text that is selected in "Work Code", i.e. "Logmein". If the text is is in fact "Logmein" it needs to take "Billing Rate" multiply it by 3. If the text is anything other than "Logmein" it needs to take "Billing Rate" and multiply it by 5, then return the value.

    I tried to do this,
    =IIf([Work Code]='Logmein',[Billing Rate]*5,[Billing Rate]*3)
    Viewing the report I get #ERROR in the "Billing Rate" field.

    Then I tried this,
    =IIf([Project Hours]![Work Code] Like 'Logmein',[Billing Rate]=[Employees]![Billing Rate]*5,[Billing Rate]=[Employees]![Billing Rate]*3)

    Now when I run the report it asks me to input a value for "Project Hours" and "Employees". These values are already supposed to be there from the tables, and I still get #ERROR in the "Billing Rate" field.
    Any help would be great.
    Thank you.
  2. lika2know


    Oct 10, 2007
    You want to create a field that contains the calcuated value of billing rate times hours, right? I'm assuming the hours and the work code for those hours are on what I call the main table, but the billing rate is in a separate table?

    I would do this way: make a query with the main table and the billing rate table linked to the on the work code in the main table. Create an expression in a new field on the query that is a calculation of the rate times the hours. You can suppress the display of the billing rate if you want to.

    Then use the query in the report or form....
    BTW -- I'm assuming this works the same in 2007 as in prior versions....
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/646386

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice