Results 1 to 3 of 3
  1. #1
    Freshcan is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    2

    Dlookup()

    Hi everyone,

    I'm unable to get my DLOOKUP function to work.

    I have a Sales field and the following table that charges a Tax based on the Sale amount.

    tblTaxRate

    Rate From To
    0 0 100
    5 101 200
    10 201 300
    15 301 400

    In my query I have setup a DLOOKUP to work out the Tax rate based on the Sales Field. i.e. If it is between $101 and $200, a tax rate of 5% will be charged.

    Here is my DLOOKUP:
    Expr1: DLookUp("[Rate]","tblTaxRates","[Sales]=">"[From] & <[To]")

    Can someone identify what's wrong?



    Thank you

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    I'd try something more like:

    Dlookup("[Rate]","[tblTaxRates]","" & [Sales] &">[From] and " & [Sales] & "<[To]")

    But be warned my brain is only firing on one cylinder this afternoon!

  3. #3
    Freshcan is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    2
    Quote Originally Posted by R_Badger View Post
    I'd try something more like:

    Dlookup("[Rate]","[tblTaxRates]","" & [Sales] &">[From] and " & [Sales] & "<[To]")

    But be warned my brain is only firing on one cylinder this afternoon!
    Thank you very much! Works great! Can't thank you enough.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Dlookup
    By jarvisaurus in forum Queries
    Replies: 4
    Last Post: 01-24-2012, 01:21 PM
  2. Dlookup help
    By justhininabouti in forum Programming
    Replies: 2
    Last Post: 11-26-2011, 10:53 PM
  3. Dlookup
    By cbrsix in forum Forms
    Replies: 6
    Last Post: 11-01-2011, 10:38 AM
  4. DLookUp Help
    By ThaGreenMoose in forum Forms
    Replies: 10
    Last Post: 06-15-2011, 12:08 PM
  5. DLookup help
    By denners05 in forum Access
    Replies: 1
    Last Post: 06-11-2011, 12:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums