i have to make a report that will list only those transactions >= [begindate] AND <=[enddate]. I also have to include a running balance only for those transactions.
So i wrote this coding for the OnFormat of the Detail section of the report:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [transaction date] >= [Forms]![Select Dates]!begindate And [transaction date] <= [Forms]![Select Dates]!enddate Then
Detail.Visible = True
Else
Detail.Visible = False
End If
End Sub
It works fine.
My question is: i am only hiding that data; it is actually there on the report. However, i want to send a message & then close the report if there are no transactions during the specified dates.
I put a message & cancel = true on the nodata, but there is data so it opens the report, with the header, etc. but i don't want it to open at all!
i suppose i could write coding on the onopen that will check if there is any data for the dates specified, i just can't figure out what to write.
any suggestions? Thanks
So i wrote this coding for the OnFormat of the Detail section of the report:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [transaction date] >= [Forms]![Select Dates]!begindate And [transaction date] <= [Forms]![Select Dates]!enddate Then
Detail.Visible = True
Else
Detail.Visible = False
End If
End Sub
It works fine.
My question is: i am only hiding that data; it is actually there on the report. However, i want to send a message & then close the report if there are no transactions during the specified dates.
I put a message & cancel = true on the nodata, but there is data so it opens the report, with the header, etc. but i don't want it to open at all!
i suppose i could write coding on the onopen that will check if there is any data for the dates specified, i just can't figure out what to write.
any suggestions? Thanks