Report Code Select Case Problem...

Mitch_____W

Mitch
Local time
Today, 09:47
Joined
Oct 31, 2001
Messages
73
I am trying to have an image be visible on a Report only when a certain textbox on the report is a certain value..

I tried the code below and I get a Run Time Error '2427' "You entered an expression that has no value."

Report Code:

---------------------------------
Private Sub Report_Open(Cancel As Integer)

Select Case (text64)

Case "M. Wilson"
Me!Image63.Visible = True

End Select

End Sub
------------------------------

What is the problemo???


Thanks in advance!!!

Mitch
 
Try this:

Private Sub Report_Open(Cancel As Integer)

Select Case text64.Value

Case "M. Wilson"
Me!Image63.Visible = True

End Select

End Sub

HTH
Rob
 
Tried it... Get same error message...

It seems like a simple procedure... Does it have anything to do with the fact that it is a REPORT code module? Are there differences between FORM and REPORT modules as to what you can and cannot do?


Stumped!

Mitch
 
Ok I figured it out...

I was using the <On Open> event, when I should have been using the <On Activate> event. I guess with the <On Open> event all of the report values do not exist until after the code behind the <On Open> event.

Mitch
 
Hi Mitch

Glad you sorted it.

You were right to place the code in OnActivate event. Basically the order in which the code is executed is:
Load Event ---> Activate Event.
 

Users who are viewing this thread

Back
Top Bottom