UPDATED: not sure if I need to create another post, but updating this one. (removed the subreport)
I created a report which opens from a Form using an on_click, do cmd event procedure
Code:
DoCmd.OpenReport stDocName, acViewReport, , "[qrycatlist].[evtdate]=
Forms! [hsubform]!evtdate and [qrycatlist].[evtcategory]= Forms!
[hsubform]!evcats and [qrycatlist].[evtod]= Forms![hsubform]!evtod")
All is based on date, category, time The report is named: caterpt1
Within the header of the report (catrpt), I have a textbox that "counts" the number of people in the category based on the reports date, time, category.
The txtbox field called (tcounts) has a number of 26 (for this report). Using an expression builder I created the following
Code:
tcounts=DCount("*","[qrycatlist]","[qrycatlist].[evtdate]= [tdate] and
[qrycatlist].[evtcategory]= [tcats]")
Can the Private Sub Report_Open(Cancel As Integer) refer to the txtbox field name tcounts on the report????????
And if it can, how do I get it to refer to the txtbox tcount. I've searched and searched and can't find the answer.
How do I get the function to retrieve the "tcounts" field.
Code:
Private iTotal As Integer
Private Sub Report_Open(Cancel As Integer)
get total record count
iTotal = Report!tcounts
end Sub
OR
Code:
Private Sub Report_Open(Cancel As Integer)
' get total record count
iTotal = DCount("*", "qrycatlist") <----this needs to have the where
values of the report. (date, time, category)
End Sub
The iTotal value is not working. I don't think I am typing it in correctly or not using the right function.
I keep getting errors 2465 (can't find the field)
If i were to use the 2nd private sub report open, how would I pull the values from the main report?
I can't get the function to use it!!! Almost there but can't seem to get it all to jive. HELP!!!
The purpose of this report is to list the people in the event based on category, date and time and create extra lines based on the total number of people. (50 lines show 26 with people, and remaining blank lines with numbers) IE to write in .
i have a function after the one above the uses the iTotal. (see post #3)