The status label shows nothing or the wrong color
A WklStatusLabel stays empty, shows the raw value instead of the text of an entry, keeps a gray
(neutral) color, or shows the color of another record.
Environment
WklStatusLabel 1.23 or later, in Access forms and on Excel and Word UserForms.
Cause
- Not bound, or bound to Null. Without a Control Source (
ControlSource), the label shows its designedText; with a field that's Null, it showsNullText(empty by default). - No entry for the value. An entry matches by value: numbers by value regardless of their type, and text regardless of case. A value without an entry is shown formatted with
Formatin the designedKind, usually neutral gray. - The kind field doesn't hold a kind.
KindFieldexpects a number 0-5 or a name (neutral,ok,warnorwarning,badorerror,info,muted); any other value, Null included, counts as neutral. An entry for the value takes precedence over the kind field. - Code changed the kind field on the same record. The label reads the kind field when a value arrives, that is, on a record change; it doesn't see a later change made by code on the same record.
- New record, report, UserForm. There, the designed
Kindapplies, andKindFieldisn't read. - The detail section of a continuous form. Access creates only one instance there, which shows only the current record, and a bound one keeps Access from opening the form.
Resolution
- Set Control Source to the field or expression, and set
NullTextfor empty values. - Add one entry per value with
AddStatusItem(in Design view, so that they're stored with the form); check them withStatusItemCount. - Store a kind the label understands in the kind field, or add entries instead.
- After code changes the kind field of the current record, call
Refresh. - For a status per record of a list, use a status column of
WklGrid(wedStatus) instead of a label in a continuous form.
en/wiki/msaccess/comctl/troubleshooting/status-label-shows-nothing.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille