If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to filter records before opening a form?
How can I use a form to open another form and restrict the records show on
the opened form? |
#2
|
|||
|
|||
On the irst form, use unbound controls (text boxes, list boxes, combo
boxes...) to enter the criteria for filtering the records in the second form. Then make a query (or modify the existing one) to filter the records for the second form, and use the controls on the first form in the query criteria; for instance, if you want to filter on a first name field, put a textbox (or whatever) on the first form, called, say, txtFirstName, and in the query, add criterion: Like Forms![FistFormName]![txtFirstName] & "*" This will result in the query selecting all records with first name starting with Jo when you enter Jo in txtFirstName, so John, Joan, Joanne, Joshua etc will all be selected, while if txtFirstName is left blank, all records will be selected. This will work with any number of controls/fields to filter on, and will always filter only on those fields you have entered criteria for. Make this query the recordsource for the second form. Finally, put a command button on the first form to open the second one. HTH, Nikos "Rosz" wrote in message news How can I use a form to open another form and restrict the records show on the opened form? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange stLinkCriteria behaviour on command button | Anthony Dowd | Using Forms | 3 | August 21st, 2004 03:01 AM |
New records can't be seen | rleblanc | Using Forms | 6 | August 14th, 2004 02:43 PM |
Filter on top of form? | Mike | Using Forms | 3 | July 23rd, 2004 02:44 PM |
Searching Records | Melissa Lambino | New Users | 6 | July 20th, 2004 04:51 AM |
Recordset in subform based on field in parent form | Lyn | General Discussion | 15 | June 14th, 2004 03:10 PM |