Results 1 to 8 of 8
  1. #1
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44

    Pull up a record from a table based on values selected from cascading dropdown menues.

    I have a table from which I want to be able to pull specific records (all fields in the table "Occurrences"), by selecting a name and date from a drop down menu. The names list needs to exclude duplicates, and the date field needs to only populate dates available under that given name. I am pulling the names from a completely different table ("Agent") to eliminate duplicates, but selecting a different name from that dropdown is not pulling up new records, but rather changing the value in the first record on the "Occurences" table. As I havent been able to get even this first step to work, I havent been able to move on to using the second dropdown to select the record corresponding to the correct date.



    I have found several tutorials for similar issues, (this thread: https://www.accessforums.net/forms/p...elp-52414.html) but it doesn't quite do what I need it to do.


    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If the combo is changing the name in a record, it's bound to a field in the data; it shouldn't be. It should be an unbound control separate from the one displaying the value for the displayed record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Thanks! I have unbound it, but now selecting a new name in the drop down does literally nothing other than changing the name in the drop down

    In my date search query I have "AgentName" and "OccurrenceDate" filtered with "[Forms]![OccurrenceEdit]![CboAgentName]"

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Is the form/subform based on the query? You'd have to requery it for the changes to show.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Ok, I have set them both to Unbound, I have added language to refresh the query after each selection. The issue I am running into now is that the query is not properly pulling the data.

    The Agent Name dropdown pulls from the "Agent Name" field from the "Agent" table. This gives me a list of all the agents listing them once each. It is functioning properly.

    Next I have a query to pull "Agent Name" & "Occurrence Date" from my "Occurrences" table. "Agent Name" has the "[Forms]![OccurrenceEdit]![CboAgentName]" set as a Criteria so in theory when the query is run, it will only pull the "Occurrence Date" values where the "Agent Name" value matches what is in the drop down. Unfortunately no matter what I have in the drop down the query is coming back blank.

    Thanks.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Unfortunately I can not, it has sensitive employee information in it.

  8. #8
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    After more investigation, the error seems to be in the criteria pulling from the Form. The first time I open the query after freshly opening the DB I get a pop up asking what is in the form, regardless of what is actually in the dropdown, and if I manually type in an agent name it pulls properly. It just isnt pulling it from the form itself. Every other time I run the query it no longer provides the pop up box and the query comes back completely blank.

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

Similar Threads

  1. Replies: 11
    Last Post: 06-19-2014, 09:22 PM
  2. Need to pull address from first record selected
    By tanyapeila in forum Queries
    Replies: 7
    Last Post: 03-17-2014, 02:55 PM
  3. Replies: 2
    Last Post: 11-12-2012, 03:52 AM
  4. Replies: 8
    Last Post: 02-26-2012, 09:48 PM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 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