E
edward
I'm getting the "you entered an expression that has no value" error
sometimes but not others, and I don't understand.
I'm trying to generate a report from a form. I'm actually using this to
generate one page at a time due to performance problems with printing
the entire report at once, but that's only relevant as background.
I have a form "pagesel" with an unbound text box "pagesel" and a
command button. The button's On Click event is set to a procedure which
does just
DoCmd.OpenReport "Report1", acViewPreview, ,
"pagenumber = [Forms]![pagesel]![pagesel]"
Report1 detail contains, among other things, an image control
"imageframe" and a text box "imagepath" bound to a field "imagepath" in
a table "imagetable". The OnFormat procedure for the detail section is
set to a procedure coded
Dim ip As String
ip = Me![imagepath]
Me![imageframe].Picture = Me![imagepath]
Originally this was just a simple assignment; I added the variable and
separated it into two assignments in trying to track down my problem.
When I put "1" in the pagesel box, this works fine and the Print
Preview displays when I click the command button.
When I put any larger number in the pagesel box -- such as "2" -- then
when I click the command button, I get an error message dialog
Run-time error '2427'.
You entered an expression that has no value.
The expression may refer to an object that has no value, such as a
form, a report, or a label control.
When I click Debug, it lands me on the ip = Me![imagepath] statement. I
even verified this by inserting MsgBox statements.
If it never worked, then I'd be looking for a gap in my understanding
of how the code should work. (I've been programming for almost 40
years, but have used VB very little and not at all in Access until a
couple of days ago.) But it works sometimes and fails sometimes, and I
don't understand that part.
Why?, I scream, Why?
Edward
sometimes but not others, and I don't understand.
I'm trying to generate a report from a form. I'm actually using this to
generate one page at a time due to performance problems with printing
the entire report at once, but that's only relevant as background.
I have a form "pagesel" with an unbound text box "pagesel" and a
command button. The button's On Click event is set to a procedure which
does just
DoCmd.OpenReport "Report1", acViewPreview, ,
"pagenumber = [Forms]![pagesel]![pagesel]"
Report1 detail contains, among other things, an image control
"imageframe" and a text box "imagepath" bound to a field "imagepath" in
a table "imagetable". The OnFormat procedure for the detail section is
set to a procedure coded
Dim ip As String
ip = Me![imagepath]
Me![imageframe].Picture = Me![imagepath]
Originally this was just a simple assignment; I added the variable and
separated it into two assignments in trying to track down my problem.
When I put "1" in the pagesel box, this works fine and the Print
Preview displays when I click the command button.
When I put any larger number in the pagesel box -- such as "2" -- then
when I click the command button, I get an error message dialog
Run-time error '2427'.
You entered an expression that has no value.
The expression may refer to an object that has no value, such as a
form, a report, or a label control.
When I click Debug, it lands me on the ip = Me![imagepath] statement. I
even verified this by inserting MsgBox statements.
If it never worked, then I'd be looking for a gap in my understanding
of how the code should work. (I've been programming for almost 40
years, but have used VB very little and not at all in Access until a
couple of days ago.) But it works sometimes and fails sometimes, and I
don't understand that part.
Why?, I scream, Why?
Edward