A
Afrosheen via AccessMonster.com
Good afternoon,
I'm using a query called furlough with has a date field in it called [fdate]
I also have a config table called tblconfig which has a date field called
[EndDate]
I get the [EndDate] through the dlookup.
Private Sub Form_Open(Cancel As Integer)
Dim tDate, strwhere As String
tDate = Nz(DLookup("[EndDate]", "tblconfig"))
MsgBox tDate
strwhere = "[fdate] < '" & tDate & "'"
Filter = strwhere
FilterOn = True
End Sub
What I need to do is to compare the [fdate] to the [EndDate]. For example: I
need all records < 12/31/2010. I'm hoping that the filter will take care of
this. Both fields are date fields. I keep getting an error on FilterOn=true.
When I do a ?strwhere it shows [fdate]<12/31/2010, that's all.
Am I doing this correctly? If not can you point me in the right direction.
Thank you for your help.
I'm using a query called furlough with has a date field in it called [fdate]
I also have a config table called tblconfig which has a date field called
[EndDate]
I get the [EndDate] through the dlookup.
Private Sub Form_Open(Cancel As Integer)
Dim tDate, strwhere As String
tDate = Nz(DLookup("[EndDate]", "tblconfig"))
MsgBox tDate
strwhere = "[fdate] < '" & tDate & "'"
Filter = strwhere
FilterOn = True
End Sub
What I need to do is to compare the [fdate] to the [EndDate]. For example: I
need all records < 12/31/2010. I'm hoping that the filter will take care of
this. Both fields are date fields. I keep getting an error on FilterOn=true.
When I do a ?strwhere it shows [fdate]<12/31/2010, that's all.
Am I doing this correctly? If not can you point me in the right direction.
Thank you for your help.