B
Bobby
I have a main form that has eight records that through any combination I would want to filter the records into the subform. Please is the code I created (using another users notes on this site) as a guide. My issue is that I can't get past the DoCmd.Appy Filter line. What am I doing wrong (please dumb down since this is my first attempts at VBA and Access). thank
Private Sub Command22_Click(
Dim FilterStr As Strin
Select Case Me!DateCleare
Case
FilterStr = "(DateCleared = date() or not(datecleared = date())or datecleared is null)
Case
FilterStr = "(DateCleared is null Or month([datecleared]) = month(now()) and Year([datecleared]) = year(now()))
End Selec
If FindSystemQ > "" The
FilterStr = FilterStr & " and ([system] = '" & [FindSystemQ] & "')
End I
If FindClassificationQ > "" The
FilterStr = FilterStr & " and ([classification] = '" & [FindClassificationQ] & "')
End I
If FindPriorityQ > "" The
FilterStr = FilterStr & " and ([priority] = '" & [FindPriorityQ] & "')
End I
If FindIssueQ > 0 The
FilterStr = FilterStr & " and ([issuenumber] = '" & [FindIssueQ] & "')
End I
If FindSARQ > "" The
FilterStr = FilterStr & " and ([SarNumber] = '" & [FindSARQ] & "')
End I
If FindRLNumberQ > "" The
FilterStr = FilterStr & " and ([RLNumber] = '" & [FindRLNumberQ] & "')
End I
If FindOwnerQ > "" The
FilterStr = FilterStr & " and ([owner] = '" & [FindOwnerQ] & "')
End I
If FindAssignedtoQ > "" The
FilterStr = FilterStr & " and ([ActionbyDate] = '" & [FindAssignedtoQ] & "')
End I
DoCmd.ApplyFilter , FilterSt
End Su
Private Sub Command53_Click(
DoCmd.ShowAllRecord
End Su
Private Sub Command22_Click(
Dim FilterStr As Strin
Select Case Me!DateCleare
Case
FilterStr = "(DateCleared = date() or not(datecleared = date())or datecleared is null)
Case
FilterStr = "(DateCleared is null Or month([datecleared]) = month(now()) and Year([datecleared]) = year(now()))
End Selec
If FindSystemQ > "" The
FilterStr = FilterStr & " and ([system] = '" & [FindSystemQ] & "')
End I
If FindClassificationQ > "" The
FilterStr = FilterStr & " and ([classification] = '" & [FindClassificationQ] & "')
End I
If FindPriorityQ > "" The
FilterStr = FilterStr & " and ([priority] = '" & [FindPriorityQ] & "')
End I
If FindIssueQ > 0 The
FilterStr = FilterStr & " and ([issuenumber] = '" & [FindIssueQ] & "')
End I
If FindSARQ > "" The
FilterStr = FilterStr & " and ([SarNumber] = '" & [FindSARQ] & "')
End I
If FindRLNumberQ > "" The
FilterStr = FilterStr & " and ([RLNumber] = '" & [FindRLNumberQ] & "')
End I
If FindOwnerQ > "" The
FilterStr = FilterStr & " and ([owner] = '" & [FindOwnerQ] & "')
End I
If FindAssignedtoQ > "" The
FilterStr = FilterStr & " and ([ActionbyDate] = '" & [FindAssignedtoQ] & "')
End I
DoCmd.ApplyFilter , FilterSt
End Su
Private Sub Command53_Click(
DoCmd.ShowAllRecord
End Su