Results 1 to 2 of 2
  1. #1
    csoseman is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    1

    Check to see if record id exists in joined table


    Is there a function that will return a boolean value to check to see if one record exists in a joined table? For example:

    In one table you have a list of customers and their respective customer IDs:
    customerID - PK
    customerName
    customerAddress
    etc....

    In another table you have:
    orderID - PK
    customerID - lookup field
    orderAmount
    etc....

    Is there a built in function to do a boolean test to see if customer ID has any orders on record in the orders table? Any help would be appreciated!

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Depending on what you're going to do with the results you can do it one of two ways.

    one is to create a query that only returns the results you want to see, then count the records in that data set before you do anything else.

    The other option is to use the dcount function. domain functions (dsum, dcount, davg, dlookup, etc) are very inefficient though and should not be used (in my opinion) for frequently repeated tasks.

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

Similar Threads

  1. Replies: 0
    Last Post: 06-15-2011, 07:02 AM
  2. Testing if a record exists on a Table
    By axess_nab in forum Queries
    Replies: 2
    Last Post: 06-14-2011, 12:27 PM
  3. How to test of record exists in table?
    By tdaccess in forum Access
    Replies: 3
    Last Post: 04-13-2011, 10:22 AM
  4. How to check if a node of a tree exists
    By weekend00 in forum Programming
    Replies: 2
    Last Post: 10-27-2010, 09:34 AM
  5. Re: Adding a new record to a joined table
    By Mcdodre in forum Access
    Replies: 4
    Last Post: 06-30-2010, 12:07 PM

Tags for this Thread

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