Here’s my issue. I have a form with a subform. I’m trying to filter my subform with a button click and two text boxes on the main form. The two text boxes are the begin date and then end date which filter the subform based on the date in the subform. When I click the button it only shows the first record.
Private Sub btnFilter_Click()
Dim Beginning As Date
Dim Ending As Date
Beginning = Me.txtBeginDate.Value
Ending = Me.txtEndDate.Value
If Not IsNull(Beginning) And Not IsNull(Ending) Then
Me!outputWindow.Form.RecordSource = "SELECT firstName, LastName, department, fppeID, fppeDate FROM FPPE WHERE fppeDate >= '" & Beginning & "' AND fppeDate <= '" & Ending & "' ORDER BY " & fppeDate & " "
'DoCmd.Requery
Else
MsgBox "you need to enter a beginning and end date!"
End If
End Sub
Does anyone have any ideas on how to solve this?
Thanks!!
Private Sub btnFilter_Click()
Dim Beginning As Date
Dim Ending As Date
Beginning = Me.txtBeginDate.Value
Ending = Me.txtEndDate.Value
If Not IsNull(Beginning) And Not IsNull(Ending) Then
Me!outputWindow.Form.RecordSource = "SELECT firstName, LastName, department, fppeID, fppeDate FROM FPPE WHERE fppeDate >= '" & Beginning & "' AND fppeDate <= '" & Ending & "' ORDER BY " & fppeDate & " "
'DoCmd.Requery
Else
MsgBox "you need to enter a beginning and end date!"
End If
End Sub
Does anyone have any ideas on how to solve this?
Thanks!!