I have some procedures in place that generates a report with a subreport. I have a coaches table and I have a trainee table. After the coaches meet with the trainees they enter information into the database, which is a log. They enter a narrative, the date of the meeting, the start time, and the end time.
For each trainee I create two reports with the data. The Main report focuses on the narrative with the date and times. The second report is the subreport. It has 31 days in it in which it identifies the days the coach met with the trainee, the start time, and the end time of the meeting. There is a field for each day for the coach’s initials. That is, if they meet on a day, the coach’s initials will be in that day’s initials field.
Example:
Day
Day5
start time
9:40 AM
end time
10:00 AM
initials
CO
Here is what happens next. For every day (31 days) I have images on the report for each coach’s initials with the property Visible = False that will display in the appropriate box if the criteria is correct. Currently, there are two coaches. In the example above, the image for Coach Orwell will show up in the box for Day5. This works great! I am using Select Case in the OnLoad Event. For above it is:
Start of Code BU (I know this is not good formatting)
Select Case Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!Day5
Case "CO"
Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!imgInitialsSmallCO5.Visible = True
Case "AW"
Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!imgInitialsSmallAW5.Visible = True
End Select
End of Code
Now comes the problem. I can run a similar report for all the trainees using almost the exact code and get the exact same report with a record for each trainee, which displays as one page per trainee. On the first record the initials display correctly. The rest of the pages do not. Whatever displays for the first record displays for all of them. I have tried putting this in the OnLoad Event, OnCurrent, OnPage and none of it helps.
Start of Code BU (I know this is not good formatting)
Select Case Day5
Case "CO"
imgInitialsSmallCO5.Visible = True
Case "AW"
imgInitialsSmallAW5.Visible = True
End Select
End of Code
Does anybody have any suggestions as to why and are able to offer a solution. Also, where do I find how to display code properly in these posts?
Thank you.
For each trainee I create two reports with the data. The Main report focuses on the narrative with the date and times. The second report is the subreport. It has 31 days in it in which it identifies the days the coach met with the trainee, the start time, and the end time of the meeting. There is a field for each day for the coach’s initials. That is, if they meet on a day, the coach’s initials will be in that day’s initials field.
Example:
Day
Day5
start time
9:40 AM
end time
10:00 AM
initials
CO
Here is what happens next. For every day (31 days) I have images on the report for each coach’s initials with the property Visible = False that will display in the appropriate box if the criteria is correct. Currently, there are two coaches. In the example above, the image for Coach Orwell will show up in the box for Day5. This works great! I am using Select Case in the OnLoad Event. For above it is:
Start of Code BU (I know this is not good formatting)
Select Case Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!Day5
Case "CO"
Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!imgInitialsSmallCO5.Visible = True
Case "AW"
Reports!rptDAILYLOGMONTHLYCurrent!rptMRDDMONTHLY1.Report!imgInitialsSmallAW5.Visible = True
End Select
End of Code
Now comes the problem. I can run a similar report for all the trainees using almost the exact code and get the exact same report with a record for each trainee, which displays as one page per trainee. On the first record the initials display correctly. The rest of the pages do not. Whatever displays for the first record displays for all of them. I have tried putting this in the OnLoad Event, OnCurrent, OnPage and none of it helps.
Start of Code BU (I know this is not good formatting)
Select Case Day5
Case "CO"
imgInitialsSmallCO5.Visible = True
Case "AW"
imgInitialsSmallAW5.Visible = True
End Select
End of Code
Does anybody have any suggestions as to why and are able to offer a solution. Also, where do I find how to display code properly in these posts?
Thank you.