Searching Description Fields

mriggio

Board Regular
Joined
Jul 28, 2002
Messages
54
I am trying to filter or search through a field of a subform. If I have a description that reads: "Document for sales agreement; No signature" and then another description for another record that reads: "Maintenance contract; No signature"; I would like to be able to add a text entry box where I could entry criteria for a search like "no signature" and then a macro that references that criteria and, in the subform, show only those records whose description field contains "no signature." So it's like a filter...

Any ideas.

Thank you so much.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi mriggio,

The key is the formula Instr() typed in the field name field in a query like:

searchfor: InStr([rectype],[Forms]![FrmDocType]![TxtSearch])

Adjust rectype to your field name. and [Forms]![FrmDocType]![TxtSearch] to the name of the textbox where you will put your text criteria.

I've posted an example here, maybe it will help:

http://www.theillumni.com/posts/searchstring.zip

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,519
Messages
6,160,294
Members
451,636
Latest member
ddweller151

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top