Results 1 to 14 of 14
  1. #1
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11

    ComboBox to Run Query and enter Parameter


    I have a query which looks up certain machines in a database then lists the rest of the information in that table that goes along with it. I have created a combo box which I would like to run that query. The items in the drop down would be a list of the machines which would then be typed into the criteria which would then look up that machine. Anyone able to help me with this? Seems simple but I am unable to figure it out. I am a beginner.

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Still on my first coffee.
    I guess I don't understand what it is you are wanting to do.

    The items in the drop down would be a list of the machines which would then be typed into the criteria which would then look up that machine
    This line does not make sense to me.

    Dale

  3. #3
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    Quote Originally Posted by rzw0wr View Post
    Still on my first coffee.
    I guess I don't understand what it is you are wanting to do.



    This line does not make sense to me.

    Dale
    Hi Dale,

    In the combobox, I would like it to list each machine.

    Once clicked it will run the query and whichever machine is clicked, it would enter that into the parameters for the query.

    So the query would have [Machine Name]

    And whichever machine was selected from the combobox would be entered into [Machine Name] resulting inthe query looking up that specific machine.

    hope that cleared it up.

  4. #4
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Ok. You want a combo box with a list of machines, when you select a machine, the data for that machine will populate a form. Correct.

    Dale

  5. #5
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    Each machine in the table has many parts. If I were to type the machine into the Query criteria anywhere from 5 to 50 rows would appear.

    When the machine is selected, I would like it to enter the machine name into a query that I have created. the query has [Machine Name] in the criteria. Once a machine is entered into the query it will populate the table with the rows which apply to that machine only.

    Quote Originally Posted by rzw0wr View Post
    Ok. You want a combo box with a list of machines, when you select a machine, the data for that machine will populate a form. Correct.

    Dale

  6. #6
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Look at your combo box query. Note the FIRST field there. Mine would be the machine ID.
    In the query you want to filter, under that field type, Forms!YourFormName!YourComboBoxName

    Change YourFormName to actual form Name and YourComboBoxName to actual combo box name.

    Dale

  7. #7
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    Quote Originally Posted by rzw0wr View Post
    Look at your combo box query. Note the FIRST field there. Mine would be the machine ID.
    In the query you want to filter, under that field type, Forms!YourFormName!YourComboBoxName

    Change YourFormName to actual form Name and YourComboBoxName to actual combo box name.

    Dale
    Okay, I understand it all except the first line. I'm not exactly sure how to access the combobox query. Am I creating the combo box through the wizard? My apologies, I am very new to Access.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    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.

  9. #9
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    The first entry in your combo box is usually the bound column.
    We want this column to filter by.
    You can see the combo box query by putting the form in design view, selecting the combo box and looking on the property sheet in the data tab under Row Source.

    Dale

    Thanks june7.
    I was helping my grandson with his train track.

  10. #10
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    Okay still having trouble (sorry folks).

    If anyone is willing to get hands on here it would be much appreciated and I have uploaded it to the link below.

    http://www.mediafire.com/download/86...nventory.accdb
    http://www.mediafire.com/download/p6...ventory.laccdb

  11. #11
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Where are the machines in your database?

    Dale

  12. #12
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    They are in the parts inventory database and they are under the category database (some are machines some are company names) thats what I would like in the drop down list .

  13. #13
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    You need to create more tables for this to work.
    machines.
    parts
    vendor
    PO Number
    Account
    Category.

    All this data in 1 table will be very hard to manipulate.

    Take a look at this site.
    http://symplebyte.com/microsoft_offi...ta_access.html

    Dale

  14. #14
    tristangemus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    11
    Okay thank you, I will take a look at that.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-12-2012, 09:20 AM
  2. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  3. Query can't pull parameter from combobox
    By testsubject in forum Queries
    Replies: 3
    Last Post: 03-08-2011, 11:26 AM
  4. Parameter Query with Combobox?
    By Krs13 in forum Forms
    Replies: 3
    Last Post: 12-21-2010, 06:15 AM
  5. Enter Parameter Value
    By plesser in forum Access
    Replies: 1
    Last Post: 11-08-2008, 10:27 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