Results 1 to 7 of 7
  1. #1
    m011 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    4

    ComboBox To Control a Data Sheet

    Hi all,


    I am trying to create a subform that has a combobox in it controlling a datasheet that is below it. When I click on the name of the candy producer, I would like the datasheet to show the different varieties of candy that producer makes. I have one table that lists all of the candy producers, with each one having a unique ID, as well as a few other fields. Then, I have another table for the candy varieties which is made up of a composite key - the producer ID and the candy variety ID. These varieties are stored in a separate table. My problem is that I cannot figure out how to set up the subform so that when you click on one of the 16 different candy producers, the datasheet below displays the candy varieties which that producer makes.

    Hopefully I have given enough information for someone to be able to help.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Could possibly have the subform be a dynamic parameterized query that pulls records from the ProducerCandy table with the parameter being a reference to the combobox.

    Why do you need this arrangement? What are you trying to do - data entry of some sort?
    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.

  3. #3
    m011 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    4
    That sounds like a good idea, but I have no clue how I would do something like that.

    It's a school assignment, but yes data entry is the main purpose.

  4. #4
    m011 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    4
    I should also add that I am not using any programming, it's more or less supposed to be using the wizards contained within access.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Sorry, but you're not going to do that with Wizards; it's going to take some VBA code! The concept is usually referred to as "cascading comboboxes," where a second Combobox is populated depending on the selection from the first Combobox In this case, instead of basing the Combobox's RowSource on the selection from the Combobox, you'd base the RecordSource of the Form on it. Here are a couple of links with examples:

    http://www.fontstuff.com/access/acctut10.htm

    http://bytes.com/forum/thread605958.html

    If you Google the term "Cascading Comboboxes" along with "MS Access" you'll probably get a gazillion hits!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    The wizards do use code called macros. I am confused about what you want. You said you want to control a subform but what Linq describes is what most people are actually looking for.
    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.

  7. #7
    m011 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    4
    Sorry, I probably didn't give enough information.

    But I figured out what I was doing wrong from my classmates. When using the form wizard, I had to create the form with a subform as I was using fields from different tables. The wizard gives the user this option after selecting which fields they want. I was selecting the option that gave just one form.

    Thanks to those who tried to help!

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

Similar Threads

  1. Replies: 7
    Last Post: 09-04-2013, 03:28 PM
  2. Data sheet forms
    By calobo in forum Forms
    Replies: 1
    Last Post: 12-07-2012, 10:12 AM
  3. Combobox control for linked form/subform
    By Dbusse706 in forum Access
    Replies: 2
    Last Post: 07-03-2012, 07:49 PM
  4. Wildcard search within ComboBox to control RowSource
    By CaptainKen in forum Programming
    Replies: 22
    Last Post: 05-16-2012, 02:19 PM
  5. Use combobox to control Subform
    By bundy75 in forum Forms
    Replies: 2
    Last Post: 09-22-2010, 03:31 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