Results 1 to 3 of 3
  1. #1
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    Why is "false" showing up in my criteria?

    Banging my head already this morning! Trying to open a report using the criteria from 2 multiselect list boxes:


    Code:
    Private Sub Command37_Click()Dim strLinkCriteria As String
    Dim varItem As Variant
        Dim str As String
    Debug.Print str
    
    
    strLinkCriteria = strLinkCriteria = "[bidstatus] In ("
     
    For Each varItem In Me.BidStatus.ItemsSelected
          strLinkCriteria = strLinkCriteria & "'" & Me.BidStatus.ItemData(varItem) & "', "
    Next
     
    strLinkCriteria = Left(strLinkCriteria, Len(strLinkCriteria) - 2) & ")"
     
    DoCmd.Openreport "BidReportbyMfrSummary", acViewPreview, , strLinkCriteria
    
    
    End Sub
    Somewhere I'm picking up a "false"


    Yet, debug.print shows it correctly: Where BidStatus IN ('Open/Quote')

    Where can I find this mysterious false?

    Thanks in advance!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You don't need any code to do this.
    use a query. No errors in a query.
    but,

    =Left(strLinkCriteria, Len(strLinkCriteria) - 2) )

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,275
    Here?
    Code:
    strLinkCriteria = strLinkCriteria = "[bidstatus] In ("
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 3
    Last Post: 10-17-2017, 04:46 AM
  2. Replies: 4
    Last Post: 06-18-2015, 09:37 PM
  3. Replies: 5
    Last Post: 05-28-2015, 03:24 PM
  4. Replies: 13
    Last Post: 06-23-2014, 01:07 PM
  5. SELECT "False" if any records are false?
    By Azurewrath in forum Queries
    Replies: 6
    Last Post: 12-21-2011, 03:36 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