I have a report which lists winners of a competition (txtUnit) in the order of their scores (position), with Position 4 being the highest score and Position 1 the lowest. A label (lblPlacing) shows either "Winner" or "Second Place" depending on the position. The problem is compounded by the requirement to show teams that competed for Honours Only (lblHO), who are not entitled to win the trophy.
The following code is in the On Print event of the Detail Section:
My problem is that, under certain conditions, only three scores are shown and, therefore, Position 4 becomes blank.
I therefore need Case 4 to be ignored and the parameters for Case 4 to be used in Case 3.
What I am trying to achieve with the Select Case TxtUnit is to say that, if TxtUnit is null, then nothing is printed, otherwise the Position and Honours Only labels are visible.
The first part of the code works well but, as you can see, I have had to rem out all reference to the Select Case because this effectively makes lblPlacing invisible for all cases. I think the problem is with "Case Nz(txtUnit)" for which I am not sure if my syntax is correct.
Any ideas would be most welcome
Best Regards
John
The following code is in the On Print event of the Detail Section:
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Select Case Position
Case 4
Select Case Honours_Only
Case True
lblPlacing.Caption = "Actual Winner"
LblHO.Visible = True
Case Else
lblPlacing.Caption = "Winner"
LblHO.Visible = False
'Select Case TxtUnit
'Case Nz(TxtUnit)
'lblPlacing.Visible = False
'LblHO.Visible = False
'Case Else
'lblPlacing.Visible = True
'LblHO.Visible = True
'End Select
End Select
Case 3
Select Case Honours_Only
Case True
lblPlacing.Caption = "Actual Second Place"
LblHO.Visible = True
Case Else
lblPlacing.Caption = "Second Place"
LblHO.Visible = False
'Select Case TxtUnit
'Case Nz(TxtUnit)
'lblPlacing.Visible = False
'LblHO.Visible = False
'Case Else
'lblPlacing.Visible = True
'LblHO.Visible = True
'lblPlacing.Caption = "Winner"
'End Select
End Select
Case 2
Select Case Honours_Only
Case True
lblPlacing.Caption = ""
LblHO.Visible = True
Case Else
lblPlacing.Caption = "Second Place"
LblHO.Visible = False
'Select Case TxtUnit
'Case Nz(TxtUnit)
'lblPlacing.Visible = False
'LblHO.Visible = False
'Case Else
'lblPlacing.Visible = True
'LblHO.Visible = True
'lblPlacing.Caption = "Second Place"
'End Select
End Select
End Select
End Sub
My problem is that, under certain conditions, only three scores are shown and, therefore, Position 4 becomes blank.
I therefore need Case 4 to be ignored and the parameters for Case 4 to be used in Case 3.
What I am trying to achieve with the Select Case TxtUnit is to say that, if TxtUnit is null, then nothing is printed, otherwise the Position and Honours Only labels are visible.
The first part of the code works well but, as you can see, I have had to rem out all reference to the Select Case because this effectively makes lblPlacing invisible for all cases. I think the problem is with "Case Nz(txtUnit)" for which I am not sure if my syntax is correct.
Any ideas would be most welcome
Best Regards
John