A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to filter records before opening a form?



 
 
Thread Tools Display Modes
  #1  
Old September 29th, 2004, 05:07 PM
Rosz
external usenet poster
 
Posts: n/a
Default 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  
Old September 30th, 2004, 08:18 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 02:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.