Showing only specific records in subform

danikuper

Registered User.
Local time
Today, 15:22
Joined
Feb 6, 2003
Messages
147
I have a table with orders (orderID, customer name, $$$, etc.) and a form that shows all fields for easy data entry.

I'd like to have a combo-box where the user can select a month (Jan, Feb, Mar, etc.) and the form will show only the records for that month.

I think it's possible if I use a main form for the combo box and a subform based on my initial form for data entry but I'm not sure how to restrict showing records based on the user selection.

Is there an easy way of accomplishing this?

thanks!

:)
 
You can use your current form and base it on a parameter query where the query gets its criteria from the combo box. Selecting a month in the combo box and requering the form will filter the form to show only the selected month.

You can use a form/subform if you like. Just set the Child Link to the date field and the Master link to the combo box.

hth,
Jack
 
Jack,

Could you please be more specific? I get what you are saying but I have no clue on how to implement that....

By the way, how would I requery the form based on the month selected on the combo box if the value from the list is, for example, Jannuary, and the values in my table are 01/01/2003; 01/12/2003; etc... ?

thanks!

dk
 
In your query add a column and add this to the Field line:

selDate: Month([NameOfFieldWithDateGoesHere])

In the criteria of that column put this:

[Forms]![NameOfFormWithComboBox]![ComboBoxName]

Create a two field table (1st field Number and 2nd field Text) and in the first field put the month of January (1) and January in the next field. Then put in 2 and February... you get the idea.

Base your combo box on this table and hide the first column so you only see the month names. Be sure the Bound Column in the combo box is 1.

Base the form on the query. Now do the Me.Requery in the After Update event of the combo box or do the subform with the links as I described except the Child link is the selDate field.

Jack
 
HOORAY! You are welcome and I am glad it worked for you.

Jack
 

Users who are viewing this thread

Back
Top Bottom