[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

move command

Posted on 2001-09-13
4
Medium Priority
?
128 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 54

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 150 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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 …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
Suggested Courses

834 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