expression with no value?!

Stefanw

Registered User.
Local time
Today, 17:01
Joined
Jan 15, 2007
Messages
20
I want to sum some values in my report, but it gives me an error:
You entered an expression that has no value.

Option Compare Database

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Dim runsum As Integer

runsum = Me.quantity1 + Me.quantity2 + Me.quantity3 + Me.quantity4 + Me.quantity5

Me.totalamount = runsum

End Sub



What's wrong with my code???
Thanks a lot
 
If quantity1, quantity2, quantity3, quantity4, and quantity5 are all null, then you have no expression.

Additionally, if you're building the "runsum" field in the detail section (and you are according to your code) and the quantity1..quantity5 fields are also in the detail section, it will fail. You can't do summarizing and individual values both in the detail section of a report.
 
Use the RunningSum property of an unbound textbox
 
solution?!

Yes, i am doing the sum in the detail section, there isn't a way to get it all worked? And yes, I need some coding to avoid errors with the null fields.

Please any help???
 
Stefanw said:
Yes, i am doing the sum in the detail section, there isn't a way to get it all worked? And yes, I need some coding to avoid errors with the null fields.

Please any help???
Try reading the previous post and look up the Nz function
 

Users who are viewing this thread

Back
Top Bottom