How to gray out Labels?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a combobox ('sexcode', in this example) that if 'f' (for 'female') is
chosen, I want to gray out a frame that holds an Option Group. I want to
also gray out an Unbound label ('Label8' , in this example) next to the
Option group. The following code grays out the Option group, but gives me an
error for the Label. I'm a VB novice, so how can I tweak this to also gray
out the Label?

Dim sexcode As String
If sexcode = f Then
Label8.Enabled = False
Me!Frame9surg_sterl.Enabled = False
Else
Me!Frame9surg_sterl.Enabled = True
End If
 
If the label is associated (or "stuck") to the option group frame, it will
disable at the same time which you code is run. To do that, simply Cut the
lable, then select the option group and Paste it. Using the move handle at
the upper left corner of the label, you can reposition it on the option
group.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
If the label is not associated with the option group, try:
Me!Label8.Enabled = False
 
Thank you, Arvin! Cutting the label, selecting the option group, then
pasting the label back in did the trick!

Thanks again, Patrick
 
Back
Top