Making Image Visible

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I make an image visible or invisible, depending upon a field in a record? For instance, I want to place a colorful .jpg behind the fields (which are transparent) in a record. If a particular value or greater appears in one of those records, I want the image to appear, effectively highlighting the record. Otherwise the image would be invisible.
 
The image object has a 'visible' property. If you're
using the 'single form' view, use the OnCurrent() event of
the form to toggle it on or off. This approach doesn't
work for 'continuous forms'.

eg)

Private Sub Form_Current()
Dim ctl as Control
Set ctl = Me!imgMyImageControl
If IsNull(Me!txtMyDataControl) Then
ctl.Visible = True
Else
ctl.Visible = False
End If
End Sub

good luck.
-----Original Message-----
How do I make an image visible or invisible, depending
upon a field in a record? For instance, I want to place a
colorful .jpg behind the fields (which are transparent) in
a record. If a particular value or greater appears in one
of those records, I want the image to appear, effectively
highlighting the record. Otherwise the image would be
invisible.
 
Rats. I need to do it in continuous form mode. It's just a way to make the background prettier. I'm doing it right now with conditional formatting and colors, but I'd like to use an image because it fits with the rest of the form themes in this particular database

----- Elwin wrote: ----

The image object has a 'visible' property. If you're
using the 'single form' view, use the OnCurrent() event of
the form to toggle it on or off. This approach doesn't
work for 'continuous forms'

eg

Private Sub Form_Current(
Dim ctl as Contro
Set ctl = Me!imgMyImageContro
If IsNull(Me!txtMyDataControl) The
ctl.Visible = Tru
Els
ctl.Visible = Fals
End I
End Su

good luck
-----Original Message----
How do I make an image visible or invisible, depending
upon a field in a record? For instance, I want to place a
colorful .jpg behind the fields (which are transparent) in
a record. If a particular value or greater appears in one
of those records, I want the image to appear, effectively
highlighting the record. Otherwise the image would be
invisible
 
Back
Top