Solved Filtering in the report

aref

New member
Local time
Today, 18:50
Joined
Jan 10, 2023
Messages
28
Hello
I made a report from the table, in this report I want the items displayed in the date column to be filtered, and this filter only includes items greater than zero, and the records that are zero or null are not seen in the report.
Thanks
 

Attachments

You want to exclude records? Apply filter criteria to report using WHERE CONDITION argument of DoCmd.OpenReport method.

Code:
Private Sub Command10_Click()
If IsNull(Cmb_date) Then
    MsgBox "Please Select date ... ", vbCritical, "*"
    Cmb_date.SetFocus
    Cmb_date.Dropdown
Else
    Date_Num = Right(Me.Cmb_date, 1)
    DoCmd.OpenReport "Tab_Data", acViewPreview, , "Date_" & Date_Num & ">0", acDialog
End If
End Sub
 
Last edited:
Fields like Date_1, Date_2, ... Date_396 - if you don't just want to play something, but want to work properly, then you should normalize very quickly and resolve columns into rows.
 

Users who are viewing this thread

Back
Top Bottom