Results 1 to 2 of 2
  1. #1
    Fealor is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    1

    Trying to make two buttons that can auto make Queries and Reports based off inputs on a Form


    So I have made a form that looks like a Wizard. This "Wizard" is for easy of use for our customers to make Reports and Queries. The "Wizard" has input boxes for the Table, Fields, certain dates (default should be all available dates), and Title of the output. What I need now is for two buttons at the end of the "Wizard" to output a Query or Report. I tried looking for a macro that could do this, but no luck and my VB skills are lacking. Can anyone give me advice on where to start or help on the coding?

    Thank You!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    dont make hundreds of queries,instead,
    make a continuous form that shows all records.
    In the header, put unbound controls for the user to enter search criteria.
    When user clicks the Find button, Test all controls for a possible filter then build the where clause:

    Code:
    sub btnFind_click()
    Code:
    sWhere = "1=1"
    if not isnull(cboState) then   sWhere = sWhere & " and [state]='" & cboState & "'"
    if not IsNull(txtName) then    sWhere = sWhere & " and [Name]='" & txtName & "'"
    if not IsNull(cboGender) then    sWhere = sWhere & " and [Gender]='" & cboGender & "'"
    
     'then filer
    if sWhere = "1=1" then
      me.filterOn = false
    else
      me.filter = sWhere
      me.filterOn = true
    endif
    end sub
    

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

Similar Threads

  1. Replies: 3
    Last Post: 07-13-2018, 12:14 PM
  2. Replies: 5
    Last Post: 12-01-2016, 02:22 PM
  3. Replies: 2
    Last Post: 07-07-2014, 09:19 AM
  4. Make command buttons unique to a record
    By timmy in forum Forms
    Replies: 26
    Last Post: 03-09-2011, 09:51 AM
  5. Refreshing Make table queries within a form?
    By umass02 in forum Queries
    Replies: 2
    Last Post: 09-03-2010, 09:14 AM

Tags for this Thread

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