Results 1 to 4 of 4
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Mulitiple types of searches

    I'm trying to have a query run a search from a search box.



    My search box: frmStatisticAnalysis
    Search Field: cboCampus
    Search Field: txtYear

    My query criteria:
    Campus: [Forms]![frmStatisticAnalysis]![txtYear]
    Year: [Forms]![frmStatisticAnalysis]![cboCampusID]

    This works great. However, I found out that I need to add a month search to it. I want it to search whether or not that field is populated. If it is populated, I want it to search all three criteria. If the month is not populated, I want it to search just the cboCampus and txtYear.

    Click image for larger version. 

Name:	query1.jpg 
Views:	12 
Size:	115.0 KB 
ID:	30547
    This is the first search

    Click image for larger version. 

Name:	query2.jpg 
Views:	12 
Size:	127.4 KB 
ID:	30548
    This didn't work

  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,521
    Try this in the month criteria, using the first pic as a start:

    http://www.theaccessweb.com/queries/qry0001.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Dude, you're awesome!! Been beating my head on a wall over that. It worked great. Thanks...

  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,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. formula/table that searches and links
    By Frans in forum Access
    Replies: 1
    Last Post: 06-18-2014, 06:57 AM
  2. Can you have mulitiple tabs bound to multiple tables?
    By Access_Novice in forum Programming
    Replies: 2
    Last Post: 01-07-2014, 11:00 AM
  3. Replies: 4
    Last Post: 10-16-2013, 01:05 PM
  4. Replies: 5
    Last Post: 11-26-2012, 03:12 PM
  5. Replies: 7
    Last Post: 10-25-2011, 08:32 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