Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Approach String search 1

Status
Not open for further replies.

fruitcake

Technical User
Feb 23, 2002
5
GB
I am trying with difficulty) to produce a search using a variable.
How can I produce a find that will look for a string of characters within a field.
i.e. I have a variable '@varfind', it is filled with the surname 'thomas'.
My find needs to look for the word 'thomas' anywhere within the 'Name' field.
The data is imported to the application with variations such as Mr Thomas, Miss C A Thomas, Sir John Thomas QC, etc.

I would like the find to work from a macro and use a table to display the results. I have tried combining a '*' with @varfind but this does not work. Yet it will work as a straight forward find. Somehow I can't build a variable with a * in front.
Rob











 
Go to find then find assistant. Click next, then click on your field and then "contains the character(s)" then put thomas in the value then done. Hope it works for you.
 
Thankyou for your reply,
My problem is that I want to do a search using a variable field. If I , for example enter, "schlossy" in the variable field how then do I ensure that "schlossy" is found anywhere in the field not just at the beginning?
I am trying to automate the search from a form view that contains the variable.
Thanks
 
Find using variables is the answer.

1) enter a value that will be valid into your varfind field.

2) go into Find mode on the form where you want to do the Find and enter this condition into any text-type field on the form:

If(Position(namefield,varfind,1) > 0)

3) press Enter or click OK to complete the Find.

4) give your Find a name by typing over the "current find/sort" on the action bar and press Enter.

That should do it!

Sue Sloan
 
Sue Sloan,
Thankyou so much , my search is now working a dream
It's great to have your guidance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top