Hi
I have a fairly large form with many labels and boxes etc. Some labels are set to alter their text onclick.
It loads seemingly ok. However when I click the label the form crashes with the aforementioned error.
The label is visible in design view. It is listed correctly in the document outline. Yet it is claimed it doesn't know about it. I've tried eliminating all 'load' events and have commented out alot of other classes but to no avail. The same code works ok on a very, very basic form so I assume it is getting bypassed by another class.
Is there some known issue/workaround/code for this type of thing for a complex form? I can wait ages after loading the form before triggering the text change and it still fails.
The code for the Label change is as follows.
Many thanks!
I have a fairly large form with many labels and boxes etc. Some labels are set to alter their text onclick.
It loads seemingly ok. However when I click the label the form crashes with the aforementioned error.
The label is visible in design view. It is listed correctly in the document outline. Yet it is claimed it doesn't know about it. I've tried eliminating all 'load' events and have commented out alot of other classes but to no avail. The same code works ok on a very, very basic form so I assume it is getting bypassed by another class.
Is there some known issue/workaround/code for this type of thing for a complex form? I can wait ages after loading the form before triggering the text change and it still fails.
The code for the Label change is as follows.
Code:
Private Sub doText(ByVal whichlabel As String) Dim labelcontrol = "labelname" & whichlabel If Me.Controls(labelcontrol).Text = "Hello" Then Me.Controls(labelcontrol).Text = "" Else Me.Controls(labelcontrol).Text = "Hello" End If End Sub
Comment