Solved

move command

Posted on 2001-09-13
4
119 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:Fireball1
  • 2
4 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 6479244
What data access method are you going to use? ADO or DAO?
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6479247
Hi Fireball1,

Use

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

or

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

regards.
0
 

Author Comment

by:Fireball1
ID: 6479261
I'm using a Data environment
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6479272
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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now