|
 |
access thread: Report Error 2427
Message #1 by "Gregory Serrano" <SerranoG@m...> on Fri, 20 Sep 2002 16:33:44
|
|
I have a form with a "print report" button it. It opens the report based
on the value of the primary key and only shows the data on the report for
that key value. This works great. So then I tried to put something on
the report's "On Open" event and tested for the value of a textbox. If
the value in the textbox is one thing, a label says X. If the value in
the textbox is another thing, the label says Y. It's a very simple
IF/THEN/ELSE statement.
Even though the report opens and executes fine, if I try to test for the
value of any field in the report, I get this error message:
"Run-Time Error 2427: You entered an expression that has no value."
But wait, fans! That expression does INDEED have a value. I can see it
when I don't try and test for it. The report opens just fine and all
values are showing. What gives? Why is the field resetting its value to
nothing just because I'm testing for it?
(I hate when I get these kind of error messages because they give NO clue
of why the error is happening! ARG!)
Greg
Message #2 by "Richard Lobel" <richard@a...> on Fri, 20 Sep 2002 08:52:14 -0700
|
|
Could you post the code so we can review it for the problem?
Richard Lobel
President
NoClassroom.com
Live Software training
Right over the Internet
richard@n...
Tel: (xxx) xxx-xxxx
Fax: (xxx) xxx-xxxx
*****ORIGINAL MESSAGE*****
I have a form with a "print report" button it. It opens the report
based
on the value of the primary key and only shows the data on the report
for
that key value. This works great. So then I tried to put something on
the report's "On Open" event and tested for the value of a textbox. If
the value in the textbox is one thing, a label says X. If the value in
the textbox is another thing, the label says Y. It's a very simple
IF/THEN/ELSE statement.
Even though the report opens and executes fine, if I try to test for the
value of any field in the report, I get this error message:
"Run-Time Error 2427: You entered an expression that has no value."
But wait, fans! That expression does INDEED have a value. I can see it
when I don't try and test for it. The report opens just fine and all
values are showing. What gives? Why is the field resetting its value
to
nothing just because I'm testing for it?
Message #3 by "Lonnie@P... on Fri, 20 Sep 2002 09:08:45 -0700 (PDT)
|
|
You may want to put your code in the On Format or On Print events for the section (Detail, Header, Footer) where the text box
resides.
During the On Open event there really isn't anything on the report, I suspect this is why you are getting the message.
Gregory Serrano wrote:I have a form with a "print report" button it. It opens the report based
on the value of the primary key and only shows the data on the report for
that key value. This works great. So then I tried to put something on
the report's "On Open" event and tested for the value of a textbox. If
the value in the textbox is one thing, a label says X. If the value in
the textbox is another thing, the label says Y. It's a very simple
IF/THEN/ELSE statement.
Even though the report opens and executes fine, if I try to test for the
value of any field in the report, I get this error message:
"Run-Time Error 2427: You entered an expression that has no value."
But wait, fans! That expression does INDEED have a value. I can see it
when I don't try and test for it. The report opens just fine and all
values are showing. What gives? Why is the field resetting its value to
nothing just because I'm testing for it?
(I hate when I get these kind of error messages because they give NO clue
of why the error is happening! ARG!)
Greg
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Let me build your next MS Access database application.
---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Message #4 by "Gregory Serrano" <SerranoG@m...> on Mon, 23 Sep 2002 16:43:17
|
|
Lonnie,
<< You may want to put your code in the On Format or On Print events for
the section (Detail, Header, Footer) where the text box resides. During
the On Open event there really isn't anything on the report, I suspect
this is why you are getting the message. >>
And you suspect correctly! It's odd that the forms are populated at the
Form Activate stage but the reports are not. Thanks.
Greg
|
|
 |