searching name & list all the possiblity?

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
pohkheng1Asked:
Who is Participating?
 
MikeP090797Commented:
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
 
pohkheng1Author Commented:
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
 
MikeP090797Commented:
Do you have a database, or a list where all the available names are stored?
0
 
pohkheng1Author Commented:
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
 
MikeP090797Commented:
You can use the Like is SQL clause as well:
"SELECT * FROM Table1 WHERE Name Like 'bil*'"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.