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
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