Disabling a Label control


Office for Mere Mortals
Your beginners guide to the secrets of Microsoft Office
Invalid email address
Tips and help for Word, Excel, PowerPoint and Outlook from Microsoft Office experts.  Give it a try. You can unsubscribe at any time.  Office for Mere Mortals has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy

Access: Disabling a Label control

Q: I need to disable a Label control, for a consistent appearance with some other controls on a form. But this control doesn’t have an Enabled property. Is there some way I can do this?

A: You can’t disable a Label control, but you can make it look disabled by setting its ForeColor property to match the color of a disabled textbox. On my computer the value of 10921638 works for this purpose. Then, when the control needs to look enabled, set the BackColor to vbBlack.

If you need to fiddle with color numbers to get a color match, use the zsfrmColors form in the sample database for Access Archon 189 (Working with Colors in Access 2007).

This form converts those new-style color values like #EFD3D2 or Accent 5, Lighter 80% (which can’t be used in VBA code) with Long values, which can be used in code.

subs profile e1563205311409 - Disabling a Label control
Latest news & secrets of Microsoft Office

Microsoft Office experts give you tips and help for Word, Excel, PowerPoint and Outlook.

Give it a try. You can unsubscribe at any time.  Office Watch has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy
Invalid email address