M
michael.galvin
Guest
Hi all
This has been driving me nuts all day! I have a form with 15 text boxes (acting as labels) and 15 text boxes (acting as themselves) on it. The 'caption' of the label textboxes comes from a table (as does the value of the text boxes) but if the caption is empty, I want to either disable or make invisible the corresponding text box.
I assume the following code would work (I'm a VBer by trade - working in Access was not my idea
)
and I'm sure it would but I can't figure out where to put it. I get a range of errors (the current one is about a property name that MA can't find). I tried label1.text, and I got the usual guff about not being able to use that property unless the control has focus, which kinda defeats the purpose.
Can anyone help me disable controls at runtime?
This has been driving me nuts all day! I have a form with 15 text boxes (acting as labels) and 15 text boxes (acting as themselves) on it. The 'caption' of the label textboxes comes from a table (as does the value of the text boxes) but if the caption is empty, I want to either disable or make invisible the corresponding text box.
I assume the following code would work (I'm a VBer by trade - working in Access was not my idea

If Len(Trim(label1.Value)) = 0 Then
text1.Visible = False
End If
and I'm sure it would but I can't figure out where to put it. I get a range of errors (the current one is about a property name that MA can't find). I tried label1.text, and I got the usual guff about not being able to use that property unless the control has focus, which kinda defeats the purpose.
Can anyone help me disable controls at runtime?