1
votes

In Microsoft Access 2013, I find that label formatting changes unintentionally when the associated textbox is disabled, if a margin is applied.

To create this problem:

  1. Place a textbox on a form. An associated label automatically appears.
  2. Select the label and set its margins to anything other than zero (set Control Margins to Medium using the ribbon, for example).
  3. Select the textbox and change its Enabled property to No.
  4. The format of the label is incorrect. There appears to be a text overlay which is not aligned properly.

The format changes whether the textbox is disabled at design time or at runtime. It reverts back when the textbox is enabled.

Is this simply a bug, or are there settings which cause this behaviour?

I have used the following workarounds; neither is handy if the label and textbox are part of a table arrangement of controls.

  1. Delete the associated label, and create an independent label for the textbox. The label is not greyed out when the textbox is disabled.
  2. Resize the label so that margins are not necessary.
1
Trying locking the textbox as well as disabling it. - Darren Bartrup-Cook
Thanks! And also setting .BackStyle = 0 which has the effect of greying it out so it is obviously disabled to users. - user3728595
@DarrenBartrup-Cook if you want to put this as an answer I will accept it, this is the workaround which I am now using. - user3728595

1 Answers

1
votes

There's four combinations with the Enabled / Locked controls on a form. The option you're after is Disabled and Locked. Neither label or control is greyed out.

I've illustrated below what you can do with each of the combinations:

enter image description here