Show/hide image on continuous form?

  • Thread starter Thread starter Stephen
  • Start date Start date
S

Stephen

I have acontinuous form (list of all customer's orders). One of the
properties of each order is whether or not is is "locked" from making
changes.

I am tyring to setup the continuous form with an image for each line that
indicates whether or not the order is locked. The image is a small padlock,
so graphically, it is clear which orders are locked.

I tried to use the following code but then realized that the code will set
ALL of teh records to teh specified case instead of allowing each record to
act independently:

If Me.Approved = True Then
Me.LockedIndicator.Visible = True
Else
Me.LockedIndicator.Visible = False
End If

Is there a way of having an image appear or be hidden (independently on each
record in a continuous form?

-Stephen
 
You cannot show/hide an image control conditionally on some rows of a
continuous form, but there is another way and it requires no code.

Place a text box on your form, and give it these properties:
ControlSource Approved
Font Webdings
Format ;\Ï

To set the Format property, type:
- semicolon;
- backslash;
- hold down the Alt key and type 0207 on the numeric keypad.

The character is a padlock (as you can see with the Character Map applet).

How does it work? Access uses -1 for True, and 0 for False. The Format
property lets you specify what to show for positive numbers and then for
negative numbers. We specified nothing for positive numbers and zero
(nothing before the semicolon separator), and then the padlock character for
negative numbers (the backslash indicates this is a literal character).
 
Allen -

This is by far one of the best "tricks of the trade" solutions I have ever
received. Thank you.

-Stephen
 
Back
Top