Solved

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

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

863 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

19 Experts available now in Live!

Get 1:1 Help Now