Results 1 to 3 of 3
  1. #1
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60

    Search Button that runs two queries

    Hello



    I am currently making a database for my co-op placement. I have had zero experience with Access prior to this experience, so there have been many bumps along the way. I am hoping to receive some guidance.

    I have a number of text boxes that I have successfully set up, that when a name is typed in them, and a search button is clicked, a query is activated and filters appropriately to what I have typed. However, I have wish to add a search box that filters data from another query, in my case these are PID which are numbers representing property. Many PIDs can be owned by one person, which is why I have kept them in separate tables and queries to stop repetition of other data.

    Is it possible that one could type a PID into a text box, click a search button, and cause two queries to be activated and filter more than one query at a time ( thus revealing the desired PID and its associated owner). I will add the very basic SQL I made to produce a functioning single query filter. I learned this from a youtube video so I'm not sure if this is a 'good' way to do it. Again, i'm new to this and am looking for guidance.

    Thank you

    Wesley

    SQL:

    Private Sub Command68_Click()
    Dim SQL As String

    SQL = "qry_Contacts_WHO"


    Me.Form.RecordSource = SQL

    Me.Form.Requery

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in the event click, either run a macro with both queries,
    or put both queries in the click event:

    docmd.openquery "query1"
    docmd.openquery "query2"

  3. #3
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60
    Worked like a charm thank you!

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

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2016, 03:41 AM
  2. Replies: 4
    Last Post: 07-17-2015, 09:11 PM
  3. Search form - Runs a query - Export to Excel
    By ryanmce92 in forum Forms
    Replies: 5
    Last Post: 04-16-2015, 06:16 AM
  4. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  5. Replies: 12
    Last Post: 03-22-2012, 02:48 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