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
Solved

searching name & list all the possiblity?

Posted on 1999-01-17
5
123 Views
Last Modified: 2010-05-03
if i input let say name = bil
so i like to get all the name that begin with "bil"
such as bill gates, bill clinton, bil and etc
pls help me out
0
Comment
Question by:pohkheng1
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1469054
You haven't specified exactly how you do the search, what data you are using, but generaly you can use Like to compare:
IF MyName$ Like "bil*" then 'do something
0
 

Author Comment

by:pohkheng1
ID: 1469055
if i input let say name = bil
    so i like to output all the name that begin with "bil"
    name such as
    bill gates, bill clinton, billy and etc that is the name that contain the string "bil" in it     name will be display
    pls help me out
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1469056
Do you have a database, or a list where all the available names are stored?
0
 

Author Comment

by:pohkheng1
ID: 1469057
yes
i'm using sql to query the match of  the input name
if the name contain the string of the input name
the record will be keep in the recordset and display in flexgrid
the problem is how the sql statement will look like
the sql are
sSql = "SELECT * FROM Makpel" & _
       " WHERE Makpel.nama = " & _
       Chr(34) & nama_s & Chr(34) & _
       " OR Makpel.nomatriks = " & _
       Chr(34) & nomatriks_s & Chr(34) & _
       " OR Makpel.alamatsemasa = " & _
       Chr(34) & alamat_s & Chr(34) & _
       " OR Makpel.namawaris = " & _
       Chr(34) & namawaris_s & Chr(34) & _
       " ORDER BY nama;"
Set daorst = daodb.OpenRecordset(sSql)

WHERE DO I HAVE TO AND THE * ?????
THANK
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1469058
You can use the Like is SQL clause as well:
"SELECT * FROM Table1 WHERE Name Like 'bil*'"
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

856 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