Solved

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

Posted on 2016-09-11
3
48 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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 earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

733 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