Reference control in OnOpen event

D

Debbie

Hello,
I have a field in my page footer called Duration. In the OnOpen event, I
would like to test the value in that field. The OnOpen event has the
following code:
If [Duration] > = 3 then
varCounter = varCounter +1
end If

When I run the report, I get the message "Runtime 2427 You entered an
expression that has no value."

How can I reference the Duration field? I've searched the forums and have
seen this syntax used. Any help is most appreciated. Thank you, Debbie
 
R

Rick Brandt

Debbie said:
Hello,
I have a field in my page footer called Duration. In the OnOpen
event, I would like to test the value in that field. The OnOpen
event has the following code:
If [Duration] > = 3 then
varCounter = varCounter +1
end If

When I run the report, I get the message "Runtime 2427 You entered an
expression that has no value."

How can I reference the Duration field? I've searched the forums
and have seen this syntax used. Any help is most appreciated. Thank
you, Debbie

Try the Load event instead of Open. Open is too soon for many data-centric
operations.
 
D

Debbie

Rick,
Thanks so much, I put it in the OnActivate (OnLoad no longer an option) and
it worked. Thanks again,
Debbie

Rick Brandt said:
Debbie said:
Hello,
I have a field in my page footer called Duration. In the OnOpen
event, I would like to test the value in that field. The OnOpen
event has the following code:
If [Duration] > = 3 then
varCounter = varCounter +1
end If

When I run the report, I get the message "Runtime 2427 You entered an
expression that has no value."

How can I reference the Duration field? I've searched the forums
and have seen this syntax used. Any help is most appreciated. Thank
you, Debbie

Try the Load event instead of Open. Open is too soon for many data-centric
operations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top