Hi. Have been trying to rename a label in access report based on certain criteria. I can easily do it in Access Forms using VBA but I can't in Report.
The problem is like this: I have a textbox and label "Startlist" minus quotation marks. I want the caption of the label to be "Order" for Field event eg Long Jump or "Lane" for Track event eg 100m.
The code I've been using is like this:
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
If Me.Type = "Field" Then
Me.StartList_Label.Caption = "Start List"
Else
Me.StarList_Label.Caption = "Lane"
End If
End Sub
NB; Type is a field in the table for either "Field" or "Track" Event.
Thanks for the help.
The problem is like this: I have a textbox and label "Startlist" minus quotation marks. I want the caption of the label to be "Order" for Field event eg Long Jump or "Lane" for Track event eg 100m.
The code I've been using is like this:
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
If Me.Type = "Field" Then
Me.StartList_Label.Caption = "Start List"
Else
Me.StarList_Label.Caption = "Lane"
End If
End Sub
NB; Type is a field in the table for either "Field" or "Track" Event.
Thanks for the help.