Solved

move command

Posted on 2001-09-13
4
120 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA to copy paste columns form one file to other 20 85
passing a value with stream reader AFTER a ";" 3 58
Copy a row 12 57
Exit a vb6 apps when a calling it apps closes 15 42
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

911 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

19 Experts available now in Live!

Get 1:1 Help Now