Reset Label Caption to the Default

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

In Access 2000, we have a form with 10 labels for which the caption needs to
display a custom string if a condition is true, and display the default, eg
the caption put in at design time, when the condition is false.

The sub to change the caption is called by the form's current event as well
as by a couple of other events and is as follows:

If condition then
me.labelA.caption = "Custom Caption"
...
Else
me.labelA.caption = "Default Caption"
...
Endif

When the condition is false, is there a way to have the label's caption
revert to the default without having to code the default back in again as
above?

Many thanks
Mike Thomas
 
Hi Mike

The saved caption is not stored anywhere accessible.

However, you could use the label's tag property:
labelA.Caption = labelA.Tag

You can either set the Tag in design view, or set it in code when the form
opens.
 
Back
Top