---------Start Code----------
=IIf([CopyBWTotal].[Form].[RecordsetClone].[RecordCount]=0,"None",[CopyBWTotal].[Form].[sumofnew]-[CopyBWTotal].[Form].[sumofused])
-----------End Code----------
Also, I think it has nothing to do with it, but I get the Unsafe Expression
error message when I open the db. I know you can turn that off in the
options, but I didn't know if that was part of my problem.
1. Open the main form in design view.
2. Right-click the subform, and choose Properties.
3. On the Other tab of the Properties box, what is the Name property of this
subform? It can be different from the name of the form loaded into the
subform (its Source Object).
4. While you are there, double-check the name of the text boxes sumofnew and
sumofused. These look like calculated fields: if so, set the Format property
of the 2 text boxs to General Number so Access understands they are numbers.
5. The expression you entered sometimes returns text ("None"), and sometimes
numbers. Additionally, the numbers could possibly be Null. Try:
=IIf([CopyBWTotal].[Form].[RecordsetClone].[RecordCount]=0, 0,
Nz([CopyBWTotal].[Form].[sumofnew],0) -
Nz([CopyBWTotal].[Form].[sumofused],0))
If that still fails, use the Immediate Window (Ctrl+G) to determine which
part is not understood. You will need to add the main form name in that
context, but try this (assuming the main form is called Form1, and it is
open):
? Forms.[Form1].[CopyBWTotal].Form.RecordsetClone.RecordCount
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"James" <Ja...@discussions.microsoft.com> wrote in message
news:9E9DAC30-A930-47AC...@microsoft.com...