move command

I am trying to make a program that uses an access database.

I need to ask after a string and then give the possible fields from the database.

Example:
In the database stands "Tom", "Anna", "Kim", "Bruno", ...
And you fill in as string "n".
Then it has to give the names "Anna", "Bruno"

Then i need to click on one of the names and then i need to go in the database to that field so i can alter it.

Can anybody help me with this

thx
Fireball1Asked:
Who is Participating?
 
TimCotteeConnect With a Mentor Commented:
Ok, so we are talking ADO. ryancys's first suggestion works here:

Dim strToMatch As String

sqlStatement = "Select * From MyTable Where MyField Like '%" & strToMatch & "%'"

Then use sqlStatement in your command object's recordsource property. Refresh the command and you have a narrowed down recordset, or alternatively use the recordset created by the command and filter it:

rsCommand1.Filter = "MyField = '%" & strToMatch & "%'"

You then have a filtered recordset with only the matching records.
0
 
TimCotteeCommented:
What data access method are you going to use? ADO or DAO?
0
 
Ryan ChongCommented:
Hi Fireball1,

Use

"Select * from myTable Where myField = '%n%'"

or

"Select * from myTable Where myField = '*n*'"

regards.
0
 
Fireball1Author Commented:
I'm using a Data environment
0
All Courses

From novice to tech pro — start learning today.