Results 1 to 4 of 4
  1. #1
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58

    Returning multiple datasets from table in a form

    Good afternoon. Relatively new to Access, and the build I'm doing needs to be very simplistic. In this case, I'm building a simple database to store vendor data and need to be able to retrieve this information from the table in which I store it.

    In this case, I've built a simple form "Vendor Search" which provides a combo-box to select the vendor you're looking for and it'll display the info accordingly. The issue I've run into is I have vendors at multiple locations, thus different data associated with each. My question is two-fold -

    1. How do I remove the duplicates from the drop-down list?

    2. How, if I select a vendor with multiple data sets, can I view the multiple listings, and not just the first one on the list?



    I've attached my dummy database to be more clear. I appreciate any assistance anyone is willing to lend.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    You need a master vendors table. Your database thus far is not normalized: http://databases.about.com/od/specif...malization.htm

    Create a new table called VendorMaster and add fields:
    VendorID automnumber
    VendorName text
    URL text,
    etc.

    Add a field to your Vendor Data table called VendorID numeric

    Create the relationship between the two - see the below diagram:
    Click image for larger version. 

Name:	vendorrelationship.jpg 
Views:	5 
Size:	19.3 KB 
ID:	7252
    YOu will have to modify your vendor search screen combo box to select from the master vendor table. You will also have to populate the new VendorID column in your Vendor Data table with the ID in the Master table.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    1. Problem with Vendor Data table is there is more than one record for each Vendor because of multiple contacts. This is a 1 to many relationship. The contact info should be in a separate child table. Including the ID field in the combobox RowSource makes every record unique so the two Vendor1 records must list as separate rows in the list. Exclude the ID field and use DISTINCT keyword to get unique list of vendor names:
    SELECT DISTINCT [Vendor Data].Vendor FROM [Vendor Data] ORDER BY [Vendor Data].Vendor;
    Change combobox properties to:
    ColumnCount: 1
    ColumnWidths: 1"

    2. Change the embedded macro to SetFilter action and the WHERE CONDITION to reference the Vendor field instead of ID: [Vendor]=[Forms]![Vendor Search]![Combo83]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58
    Thank you both for your help, this is how I'll spend the morning today. Much appreciated to you both!

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

Similar Threads

  1. Form returning last blank table row
    By Dannat in forum Forms
    Replies: 5
    Last Post: 01-30-2012, 08:36 AM
  2. Left table NOT returning all results
    By Battlecat in forum Queries
    Replies: 3
    Last Post: 11-02-2011, 08:08 AM
  3. Replies: 1
    Last Post: 10-20-2011, 07:37 AM
  4. query to add new column using two datasets
    By nlreid in forum Access
    Replies: 3
    Last Post: 11-12-2010, 07:35 PM
  5. Returning multiple records Isn't what I need
    By frobro390 in forum Queries
    Replies: 6
    Last Post: 09-21-2010, 06:24 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