Results 1 to 3 of 3
  1. #1
    cask2010 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    4

    Combining multiple Where Conditions in a BrowseTo Argument

    I'm attempting to use the BrowseTo Argument to filter a datasheet embedded on a navigation page. This database is being designed for an Auto Auction, and I want the user to be able to sort the datasheet based on the Date of the Auction, and where the transactions listed in the datasheet are complete or incomplete.

    I have a Combo Box set up that allows the user to select an auction date, with an after update macro setting a temporary variable and then a BrowseTo Macro that reopens the datasheet using a specified Where Condition. I've managed to successfully write Where Conditions that work on their own, either filtering just for the Auction Date, or filtering just to show the Incomplete Transactions. My problem is that I don't understand SQL syntax well enough to write a single Where Condition that combines these two together. Ultimately this needs to allow the end user to select an auction date from the Combo Box, and then when they click the Show Incomplete button it needs to BrowseTo the datasheet to show Incomplete Transactions FOR that Auction Date.

    Click image for larger version. 

Name:	AuctionsPage.PNG 
Views:	7 
Size:	49.4 KB 
ID:	29656
    And here's a view of my best guess for how the BrowseTo Macro should look.
    Click image for larger version. 

Name:	ShowIncompleteMacro.PNG 
Views:	7 
Size:	14.4 KB 
ID:	29657
    These two different Where Conditions work perfectly in isolation:
    ="[AuctionID_FK]= [TempVars]![tmpSelectedAuctionDate]"
    ="[Sale Complete?]=No"



    How do I concatenate them? Please and Thank you So So Much!

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Create a new query in design view
    Add both these conditions
    Go to SQL view
    Copy and paste

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Make it a single string within two quote marks and remove the other two quote marks as well as all those parens. If you do use the parens, include them within the quote marks.

    ="[AuctionID_FK]=[TempVars]![tmpSelectedAuctionDate] AND [Sale Complete?]=No"

    Advise not to use spaces or punctuation or special characters (underscore only exception) in names. Better would be IsSaleComplete or Is_Sale_Complete.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2017, 11:10 PM
  2. Combining Conditions Help
    By Holli in forum Programming
    Replies: 6
    Last Post: 05-13-2015, 01:23 PM
  3. VBA If with multiple conditions
    By Swatskeb in forum Modules
    Replies: 2
    Last Post: 05-22-2014, 04:22 PM
  4. Replies: 14
    Last Post: 07-22-2013, 12:39 PM
  5. Replies: 6
    Last Post: 08-23-2012, 05:06 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