K
Kevin Vaughan
Thanks Nikos,
I tried your suggestion, but my real problem is that I am trying to use the
variable called CompetencyName within the .Filter statement so that I can
use the same code for Extinguisher and Evacuation training and other
competencies as I do for FireVideo. It still keeps asking me for a parameter
value for CompetencyName even after I tried your code and replaced
FireVideoDate with CompetencyName as below: My apologies that I wasn't
clearer in my previous explanatio and thankyou again for your help.
Regards Kevin
Private Sub VideoButt_Click()
CompetencyLYDateCheck ("FireVideoDate")
End Sub
Public Function CompetencyLYDateCheck(CompetencyName As String)
Dim LYDate As Date
Dim strFilterDate As String
LYDate = Date - 365
With Me![Firesafety2002 subform].Form 'refer to the form object of the
SubForm
strFilterDate = Format$(LYDate, "\#mm\/dd\/yyyy#")
.Filter = "IsNull(CompetencyName) = True or CompetencyName < '" &
strFilterDate & "'"
.FilterOn = True
End With
End Function
Kevin,
Try changing to:
.Filter = "IsNull(FireVideoDate) = True or _
FireVideoDate < '" & strFilterDate & "'"
(IsNull function syntax, date in quotes).
HTH,
Nikos
I tried your suggestion, but my real problem is that I am trying to use the
variable called CompetencyName within the .Filter statement so that I can
use the same code for Extinguisher and Evacuation training and other
competencies as I do for FireVideo. It still keeps asking me for a parameter
value for CompetencyName even after I tried your code and replaced
FireVideoDate with CompetencyName as below: My apologies that I wasn't
clearer in my previous explanatio and thankyou again for your help.
Regards Kevin
Private Sub VideoButt_Click()
CompetencyLYDateCheck ("FireVideoDate")
End Sub
Public Function CompetencyLYDateCheck(CompetencyName As String)
Dim LYDate As Date
Dim strFilterDate As String
LYDate = Date - 365
With Me![Firesafety2002 subform].Form 'refer to the form object of the
SubForm
strFilterDate = Format$(LYDate, "\#mm\/dd\/yyyy#")
.Filter = "IsNull(CompetencyName) = True or CompetencyName < '" &
strFilterDate & "'"
.FilterOn = True
End With
End Function
Kevin,
Try changing to:
.Filter = "IsNull(FireVideoDate) = True or _
FireVideoDate < '" & strFilterDate & "'"
(IsNull function syntax, date in quotes).
HTH,
Nikos