Solved

searching name & list all the possiblity?

Posted on 1999-01-17
5
124 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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