Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Link fields on form from separate tables by PK (A2k)

    Can I put fields from separate tables onto a form linking by PK without using subforms, or queries?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Link fields on form from separate tables by PK (A2k)

    How would you "link" without a query ?
    Perheps you can use the DLookup function to retrieve the corresponding field in the other table.
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Link fields on form from separate tables by PK (A2k)

    Francois,
    One more question (obviously your answer was just what I was looking for...I know how to use the function and yet it didn't click in my head to think about it...)

    Which would be faster...using the query or dlookup?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Link fields on form from separate tables by PK (A2k)

    <P ID="edit" class=small>(Edited by Francois on 31-Jul-05 20:23. Add tip from help file)</P>On a table with a few records you shouldn't see a difference. On large tables, the query will be faster. Domain function (DLookup, DCount,...) are know to be slow.
    From the help file :
    <hr>Tips

    Although you can use the DLookup function to display a value from a field in a foreign table, it may be more efficient to create a query that contains the fields that you need from both tables and then to base your form or report on that query.
    <hr>
    Francois

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Link fields on form from separate tables by PK (A2k)

    Okay. Thanks a lot Francois. I'm starting to get into the minimalist mentality (do all through code where possible...), however I suppose a query is the best route now. Thanks again!
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

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