Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    printing a looked up field content (Access2K)

    Want to print a field whose content is the result of a query/table match to a field in the report.
    Report has a field named "SLOT1". It's content matches a record/field named "BOARD" in another table. In the matched table/record, I want to grab the content of a second field, "68-num" and print it in the report.
    There is nothing between the two tables/queries that can link them.
    I suspect the solution is a controlsource expression for the printing field. Use report "slot1" content to look up matching record in "board" and print content of field "68-num". I have not had any luck in building the expression.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: printing a looked up field content (Access2K)

    Here is one possibility: set the Control Source of the text box to
    <pre>=DLookup("[68-num]", "[NameOfOtherTable]", "[BOARD]='" & [SLOT1] & "'")</pre>

    Replace NameOfOtherTable by the name of the table containing the fields 68-num and BOARD. I have assumed that BOARD and SLOT1 are text fields. Note the use of single quotes. If they are numeric, use this instead:
    <pre>=DLookup("[68-num]", "[NameOfOtherTable]", "[BOARD]=" & [SLOT1])</pre>

    There are other possibilities; post back if this one doesn't do what you want, or makes your report too slow.

  3. #3
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: printing a looked up field content (Access2K)

    Hans,
    Thanks for the reply. The first example worked great!

Posting Permissions

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