Solved

Fill a combo Slider field based on a value entered by user

Posted on 2016-09-11
3
38 Views
Last Modified: 2016-09-11
I have a combo field (cmbProduct) which I would like to fill with values from table SHOPITEMS matching a string entered by the user in field xSearch.  For example if the user enters  pants - the system should read table SHOPITEMS and fill cmbProduct slider with all products matching  *pants*.  Thank you for any help... Michael
0
Comment
Question by:mpim
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 41793554
You can set the RowSource of your combo to do that:

Me.YourCombo.RowSource = "SELECT Field1 FROM ShopItems WHERE SomeField LIKE '*" & Me.txSearch & "*"
0
 

Author Comment

by:mpim
ID: 41793561
Great - however I get a syntax error in the Query. The error msg is !Syntax error in string in query expression '[SHOPITEMS].[PRODUCT] LIKE '*panera*'

I used the following code in the Lost Focus Event:
Me.cmbPrd1.RowSource = "SELECT [SHOPITEMS].[PRODUCT] FROM [SHOPITEMS] WHERE [SHOPITEMS].[PRODUCT] LIKE '*" & Me.xSearch & "*"

Thank you so much for your help..
0
 

Author Comment

by:mpim
ID: 41793562
Sorry... I found the error there was a ' missing. Works perfectly... Thank you!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 5 53
Any Way to Print an Import Spec? 3 29
Reference Controls on subforms 7 27
Binding recordsets to a form 6 22
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question