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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Problem....PLEASE HELP !!!!!

Status
Not open for further replies.
Jul 17, 2001
19
US
Im trying to setup a form that has a blank text box with a search button next to it. I want to be able to type a search string into the text box, and then be able to click on the search button and have it search a table. If ANYONE knows what I need to do, PLEASE let me know.
 
Suppoose we have an Items Table. There are two waysto do that:

1st Way. Open a Table Query Based on Macro like

Click New Macro and Choose Macro Action as RunSql as shown below

Action1: RunSql
Sql Statemnt: SELECT Items.It_id, Items.It_Name, Items.It_rate FROM Items WHERE Items.It_id)=[Forms]![MyForm]![TxtSearch];

Based on the value entered on the TxtSearch in My Form the Query will open n will show u the table values.

-----------------------------------------------------------

2nd Way. Make a new tabular form caleld as MyNewForm of the table u wanna search or filter

Click New Macro n Choose OpenForm Action

Action1: OpenForm
Form Name: MyNewForm
View: Form
Filter name: leave blank
WhereCondition: [Items]![It_id] = Forms![MyForm]![txtSearch]

Leave other options as it is. When u'll run that macro behind a button, it will open the new forms matching the value given is txtSearch in Myform

Hope this will works for u :)

Cheers!
Aqif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top