rossmcm
Programmer
- Jun 28, 2000
- 16
- 0
- 0
I want to be able to write a numeric value in a report, but not write anything if the value was zero. So I was going to make the control source for the text box:
=ShowNumberIfNonZero ([Quantity])
and ShowNumberIfNonZero was to be a VB function that returned the number if non-zero, or a null string otherwise. All was going fine until I actually added the the function.
I have other text boxes on the report that are calculated fields, i.e. the Control source property is not just "FirstName", but rather
=[FirstName] + " " + [LastName]
It seems that adding a VBasic routine breaks the ability to specify the expression as the control source, i.e.
=[FirstName] + " " + [LastName]
causes an error (the text box displays #NAME?). If the VB routine is not there, this calulcated field works fine.
Even if I have a VB function that's not called anywhere, as long as it's present, I can't specify expressions as the control source of the report text boxes.
I'm really keen to know why this is.
=ShowNumberIfNonZero ([Quantity])
and ShowNumberIfNonZero was to be a VB function that returned the number if non-zero, or a null string otherwise. All was going fine until I actually added the the function.
I have other text boxes on the report that are calculated fields, i.e. the Control source property is not just "FirstName", but rather
=[FirstName] + " " + [LastName]
It seems that adding a VBasic routine breaks the ability to specify the expression as the control source, i.e.
=[FirstName] + " " + [LastName]
causes an error (the text box displays #NAME?). If the VB routine is not there, this calulcated field works fine.
Even if I have a VB function that's not called anywhere, as long as it's present, I can't specify expressions as the control source of the report text boxes.
I'm really keen to know why this is.