Picture with condition

Nenya

Registered User.
Local time
Today, 17:14
Joined
Jul 4, 2003
Messages
20
I want to insert a picture that is visible only when a certain textbox is not empty.

I tried using vb, but somehow, i can't use the property visible of the image, or the property text of the textbox.

I don't know what's wrong... anyone can figure this out?:(
 
In the Report_Activate event try the following code...
Code:
Private Sub Report_Activate()

If IsNull(Me.YourTextField) Then
Me.YourImageControl.Visible = False
End If

End Sub

IMO
 
What would the code look like if I wanted multiple conditions. For example, If the Target Date is less than 14 days away then display a graphic. If the Taget Date IsNull then Don't display the graphic and finally if the CompleteDate Is filled in then don't display the graphic. It sound like multiple if then statements to me but I can't seem to get the code right.

Here is one component that is working but I need to add the other conditions.

If (Me.[Task.Target Date]) > (Date + 14) Then
Me.Image63.Visible = False
Else
Me.Image63.Visible = True
 
If (Me.[Task.Target Date]) > (Date + 14) Then
Me.Image63.Visible = False
else
If (IsNull(Me.[Task.Target Date])) then
Me.Image63.Visible = False
else
Me.Image63.Visible = True

Hope this helps

Jason
 
Sorry, forgot the Complete Date

If (Me.[Task.Target Date]) > (Date + 14) Then
If (IsNull(Me.[Task.Target Date])) then
Me.Image63.Visible = False
else
Me.Image63.Visible = True

If (IsNull(Me.[Task.CompleteDate])) then
Me.Image63.Visible = False
else
Me.Image63.Visible = True

Regards

Jason
 
Doh, not awake this morning

For the CompleteDate reverse the visible statements

Sorry

Regards

Jason
 
Thanks! I am new to VB so this helps a bunch!
 

Users who are viewing this thread

Back
Top Bottom