Solved Data show in subform based on dropdown list (1 Viewer)

kashifshahzad

New member
Local time
Today, 22:06
Joined
Jul 18, 2023
Messages
5
Could someone help me, to create a dropdown list of date (Month and year) in shed form as per attached. and based on dropdown list the sub form shows the relevant data. Thanks in advance.
 

Attachments

  • new Poultry Management System by Anfal-1 - Copy (2).accdb
    3.4 MB · Views: 59

Mike Krailo

Well-known member
Local time
Today, 15:06
Joined
Mar 28, 2020
Messages
1,044
How about two dropdowns, one for year and one for month?
 

LarryE

Active member
Local time
Today, 12:06
Joined
Aug 18, 2021
Messages
592
There are two fields that have dates. One in the Feed table and one in the MedicineDetails table. My understanding is that you want to filter these sub-forms based up a dropdown control to be placed in the Shed form. The dropdown should show the month and year only and then filter based upon the selected month and year. Is that correct?
 

kashifshahzad

New member
Local time
Today, 22:06
Joined
Jul 18, 2023
Messages
5
There are two fields that have dates. One in the Feed table and one in the MedicineDetails table. My understanding is that you want to filter these sub-forms based up a dropdown control to be placed in the Shed form. The dropdown should show the month and year only and then filter based upon the selected month and year. Is that correct?
yes it's correct.
In 'MesicineDetails' table there is a field 'Date Administered' I want to match drop down list with it.
In 'BirdDetails' table there 'Month' field defined. please add 'Year' fiels also. i want to match 'Month' and 'year' field with drop down list
In 'Feed' table there is 'DateofBuying' fields i want to match it with drop down list
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:06
Joined
Sep 21, 2011
Messages
14,315
There are two fields that have dates. One in the Feed table and one in the MedicineDetails table. My understanding is that you want to filter these sub-forms based up a dropdown control to be placed in the Shed form. The dropdown should show the month and year only and then filter based upon the selected month and year. Is that correct?
O/P already given code in crossposted thread.
 

LarryE

Active member
Local time
Today, 12:06
Joined
Aug 18, 2021
Messages
592
yes it's correct.
In 'MesicineDetails' table there is a field 'Date Administered' I want to match drop down list with it.
In 'BirdDetails' table there 'Month' field defined. please add 'Year' fiels also. i want to match 'Month' and 'year' field with drop down list
In 'Feed' table there is 'DateofBuying' fields i want to match it with drop down list
The month field in BirdDetails is meaningless. Delete it. You can only filter and search dates if there is a date field on a form that is bound to a table or query field formatted as a date. So you can filter based upon DateADministered or DateOfBuying, but not 'Month' in the BirdDetails table. Each record in the BirdDetails table should NOT have a field that is the name of any month.

In addition, if you are going to filter sub-forms by any criteria, then you will need to disable the Master/Child sub-form links temporarily and then re-establish them when you unfilter the sub-forms. If you don't disable the links, only a portion of the sub-form records may be returned by the filtering process.
 
Last edited:

LarryE

Active member
Local time
Today, 12:06
Joined
Aug 18, 2021
Messages
592
Here is your file that filters sub-forms based on Month/Year criteria.
 

Attachments

  • Poultry Management System.accdb
    4.2 MB · Views: 73

Users who are viewing this thread

Top Bottom