Results 1 to 3 of 3
  1. #1
    dawson is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2020
    Posts
    2

    Exclamation Trying to have a dialogue that will let me select from a dropdown and then will use that as a filter

    Hello,



    This might be a little advanced, I'm not really sure how to make this happen. So basically the plan is that I click a button, it opens up a small form, I click a name in the dropdown and it will take that "ID" and automatically apply it to a report that I want it to open after I hit a "Go" button.

    In this case I want to make a report that shows all Employees dates of absence for whichever employee I select from the dropdown. I "could" do this and skip the form, and have the dropdown on the report, issue being that the dropdown doesn't function on the report so it wont work. I need to make some sort of VBA/Macro that after I click does an ApplyFilter like to command to the report not the form itself as that is no use. I will include a screenshot of the forms dropdown to show its simplicity.Click image for larger version. 

Name:	Capture.PNG 
Views:	13 
Size:	6.0 KB 
ID:	43018

    This may not be the most efficient way but once I solve the issue of applying the appropriate filter, I can then work on the flow and design of the report.
    Thanks!

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    I'm confused on your work flow. Do you have a form, call it frmMain, and on it have a button to open the pop up form? Once a name is selected you then return to frmMain and hit a "Go" button?

    You would not neccessarily filter the report. You would use the docmd.openreport method and apply the Where argument to open it for the selected employee.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    Use the value of the combo as the criteria in the WHERE argument of the DoCmd.OpenReport command.

    https://docs.microsoft.com/en-us/office/vba/api/access.docmd.openreport

    This is just part of a Sub of mine, but shows the syntax/logic

    Code:
        stLinkCriteria = "[Ship] = '" & Me.cboShip.Value & "'"
        
         DoCmd.OpenReport stRptName, iPreview, , stLinkCriteria, iDialog

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

Similar Threads

  1. Replies: 3
    Last Post: 07-08-2020, 04:12 AM
  2. Filter Form with unbound dropdown
    By samot79 in forum Forms
    Replies: 11
    Last Post: 06-09-2017, 01:40 PM
  3. Multi-Select dropdown problem
    By wrkadri in forum Access
    Replies: 11
    Last Post: 07-03-2015, 03:22 AM
  4. What query to filter dropdown on subform
    By sstiebinger in forum Queries
    Replies: 3
    Last Post: 04-13-2015, 01:24 PM
  5. Replies: 6
    Last Post: 11-15-2012, 02:38 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