0
votes

enter image description here

Im trying to figure out if there is a way to link a data range which is encompassed in two textboxes with the calender button to select a date and 3 other filtering combo boxes. I want the combo boxes to filter off of each other based on the date of the record. Does anybody know if this is possible?

Thanks so much!

Private Sub cmbFleetID_AfterUpdate()
Me.cmbOwner.Requery
Me.cmbTailNumber.Requery
End Sub
Private Sub cmbOwner_AfterUpdate()
Me.cmbFleetID.Requery
Me.cmbTailNumber.Requery
End Sub
Private Sub cmbTailNumber_AfterUpdate()
Me.cmbFleetID.Requery
Me.cmbOwner.Requery
End Sub

This is the code I have so far. As you can see I have the combo boxes cascading off of each other with the code in the queries for each combo box as well [forms]![ReportNavigation]![cmbName]. I just cant figure out how to put the date range text boxes into it.

1
What have you done so far? Could you update your post with that?PaulFrancis
This example might get you started. And as @PaulFrancis stated, to receive help please add what you have done so far.Jens
I have added what I have so far. Thanks!Brianna Cates

1 Answers

1
votes

So the user will enter a date range and the three comboboxes will automatically update/requery themselves based on the date range entered?

If so, in the RowSource field of the combobox, build your query to access these fields in the form like this:

SELECT tblTestData.ID, tblTestData.ACName, tblTestData.ActiveDate FROM tblTestData WHERE (((tblTestData.ActiveDate) Between [Forms].[frmTest].[txtDateBegin] And [Forms].[frmTest].[txtDateEnd]));

Clearly, you have to replace the frmTest with your form name and txtDateBegin/End with your textbox names. With this RowSource, each requery will appropriately pull the data from your table.