Results 1 to 3 of 3
  1. #1
    cameronaziz is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    7

    Is DLookUp What I should be using?

    Hi

    Im pretty new to access. I have a form (called TestAdd) where you fill in information that populates a table called "Tests"

    I also have a table called CPTCodes with 3 columns: CPT_Code, Test, Prices.

    One of the fields is called "CPTCode." That field has a row source of

    SELECT CPTCodes.[CPT_Code], [CPTCodes].[Test Name] FROM CPTCodes ORDER BY [CPT_Code];

    Lower down on the form I want to display the price of the test. The prices of the tests are in that table called "CPTCodes"

    I want the price of the test, according to the CPTCode in the form, to be displayed on the form.

  2. #2
    cameronaziz is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    7
    The row source for my box now is

    =DLookUp("[Price]","CPTCodes","[CPTCode] = " & [Forms]![TestAdd]![CPTCode])

    but it just displays the Record's "Price" no matter what the CPTCode is on the form.

  3. #3
    cameronaziz is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    7
    FIGURED IT OUT!

    =DLookUp("[Price]","CPTCodes","[CPT_Code] = " & [Forms]![TestAdd]![CPTCode])

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

Similar Threads

  1. dlookup help
    By gsantacruz in forum Programming
    Replies: 9
    Last Post: 10-11-2010, 11:46 AM
  2. DLookup()
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 07:20 AM
  3. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  4. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 AM
  5. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM

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