searching with Star notation : "*"

I have created an application in VBA of Excel in which there are some comboboxes that interact with a data base.  

I wonder me if it exists a propriety that allows to make a search of the elements of the basic date with abbreviations type: string + " * " 
 
in other terms  
 
inserting in the combobox departs some string of text to seek followed by the notation " * " star!  
 
as it happens for the motors of search of Windows  
 
best  
 
luca  
 

FIND-A-STRING.jpg
lucamongelluzzi2009Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tony_angelopoulosCommented:
depending on the database, you could replace the * character in your vb string with % (if it's an SQL database), and in the code that interacts with the database, the select statement, you could modify it like so:

"SELECT whatever FROM table WHERE data = 'VALUE YOU ARE LOOKING FOR'"
to
"SELECT whatever FROM table WHERE data LIKE 'VALUE YOU ARE LOOKING FOR%'"

If it's access, you could simply keep the *

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tony_angelopoulosCommented:
of course, you would want to use parameters to prevent SQL injection attack.
0
northfieldsCommented:
Hi

%%(SQL) or ** (MSAccess), will return a match based on what is between the %% or **
ie %at% will return all records with "at" in string ie cat, mat,fat
%your criteria will return all matches where the values end in your search criteria ie
%day will return Monday,Tuesday,Wednesday...etc
 
your criteria% will return all matches where the values start with your search criteria ie
dog% will return Red dog, green dog etc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.