Results 1 to 2 of 2
  1. #1
    Faiz12 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    5

    Need help with Combo box value in VBA

    Hello, I'm have a category field which contains either Mobile or Broadband. I want to use a combo box which has the following values: All, Mobile, Broadband. Basically I click the filter button I made and it'll filter based on the value selected in the combo box using VBA. But the problem is if I pick either Mobile or Broadband and click the filter button, it'll ask for a parameter value as you can see from the image below. It works when I picked the All option where it'll select both Mobile and Broadband. I suspect there is an issue with my VBA code concatenation.


    Click image for larger version. 

Name:	Screenshot 2022-03-28 230540.png 
Views:	16 
Size:	20.6 KB 
ID:	47564Click image for larger version. 

Name:	Screenshot 2022-03-28 230621.png 
Views:	16 
Size:	39.1 KB 
ID:	47565Click image for larger version. 

Name:	Screenshot 2022-03-28 230641.png 
Views:	16 
Size:	40.2 KB 
ID:	47566Click image for larger version. 

Name:	Screenshot 2022-03-28 230716.png 
Views:	17 
Size:	18.6 KB 
ID:	47567

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    your combo list bound column values are text or numbers? If text you need text delimiters. Within double quotes we use singles:

    = ' " & categorySelection & " ' " (remove the extra spaces that I used to make the ' more obvious).

    Also, make that Me.Combo30 (don't need .Value, but no harm using it)

    Better to post code in code tags (use # on posting toolbar) and not use pics of code.
    Last edited by Micron; 03-28-2022 at 09:26 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 11
    Last Post: 09-03-2015, 11:12 AM
  2. Replies: 7
    Last Post: 03-30-2015, 10:04 AM
  3. Replies: 2
    Last Post: 10-21-2014, 07:57 AM
  4. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  5. Replies: 4
    Last Post: 08-16-2011, 05:54 PM

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