Help with ApplyFilter on a Subform

pmcleod

New member
Local time
Today, 00:42
Joined
Aug 27, 2002
Messages
107
:confused: I have a from with a combobox that is intended to filter a datasheet subform.

Private Sub CboFilterDate_AfterUpdate()
If [Forms]![Issues Selection and Reporting]![CboFilterDate] = "Today" Then
DoCmd.ApplyFilter , [Forms]![Issues Selection and Reporting]![Issues Selection Subform]![(Year([Opened Date]) = Year(Date) And Month([Due Date]) = Month(Date) And Day([Opened Date]) = Day(Date))]
End If
End Sub

My error reads that it can't frind the "Issues Selection Subform" mentioned in the expression.

Can anyone tell me where I messed up?
 
Its bad practice to have spaces in your form names, will be alot easier if you rename then without the spaces.

After removing spaces you could use different code to ahieve your desired results.

Code:
Private Sub CboFilterDate_AfterUpdate()
If form_IssuesSelectionandReporting.CboFilterDate = "Today" Then
IssuesSelectionSubform.filter = PUT YOUR CRITERIA HERE
IssuesSelectionSubform.filteron = true
End If
End Sub
 
Error Came up....

I took your advise ... but now see an error that reads...Can't find the field '|' refered to in your expression. What is '|'?
 

Users who are viewing this thread

Back
Top Bottom