Solved

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

Posted on 2016-09-11
3
25 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now