get runtime 2488 when executing DoCmd.ApplyFilter

dai_lo

Registered User.
Local time
Today, 01:45
Joined
Jan 10, 2008
Messages
30
Hi ,

I keep getting runtime error 2488 when executing the following code highlighted in Red:

Private Sub cmd_Total_Cairo_Per_Month_Click()
Dim tostring As Date
Dim fromstring As Date


fromstring = CDate(Format(InputBox("Please enter from month and year (mmm yyyy)"), "mmm yyyy"))

tostring = CDate(Format(InputBox("Please enter to month and year (mmm yyyy)"), "mmm yyyy"))

DoCmd.OpenQuery "qry_total_Cairo_per_month"

DoCmd.ApplyFilter , "[qry_MonthlyStats_All_Dept.Received] Between #" & fromstring & "# And #" & tostring & "#"

If Itm_List_Dept.Value <> "(ALL)" Then
DoCmd.ApplyFilter WhereCondition:="[Dept] = '" & Itm_List_Dept.Value & "'"
End If
End Sub


Please note [Received] is date with format of "mmm yyyy"

please advise

thanks

little Al
 
DoCmd.ApplyFilter , "[qry_MonthlyStats_All_Dept.Received] Between '#" & fromstring & "#' And '#" & tostring & "#'"

???
 
DoCmd.ApplyFilter , "[qry_MonthlyStats_All_Dept.Received] Between '#" & fromstring & "#' And '#" & tostring & "#'"

???

Ken,

it doesn't work

thanks
little Al
 

Users who are viewing this thread

Back
Top Bottom