Allen
I ran =IIf([MYOB_Cards query subform].[Form].[RecordsetClone].[RecordCount] =
0, 0, [MYOB_Cards query subform].[Form]![Text30])
and it came up with #Name?
I ran my [MYOB_Cards query subform] in Single form and there are,nt any
fields visible excepth the two calculation fields in the form footer and they
are blank.
Maybe if I try to explain what I'm doing (or rather trying to do).
My main form has been used as form that appends data to a [parts] table and a
[time table] table.
Cbo selects {job Id} and the form pulls up parts and labor for that [Job Id].
It totals the total parts cost
and labor cost in their own respective fields.
On my Subform [MYOB_Cards query subform] the Child is matched with master
[Job Id].
The information is gotton from a query based on a accounting software which
the tables
are linked via odbc.
I'm able to add the parts from both forms and make a Grand total on the
Main form.
Here is the crux of the problem (I Think?) When the Child and Master match
but
no records have been put in to the accounting software there are no fields
in my
[MYOB_Cards query subform] and the equation fails #error.
How can I have my total Parts $ on my main form disregard my subform
[MYOB_Cards query subform] parts $ and just calculate the main form parts.
Then
if there is data in [MYOB_Cards query subform] parts calculate the parts in
Main form + parts in [MYOB_Cards query subform]
To try to make the above a nut shell:
Total parts $ in Main + Total Parts $ in [MYOB_Cards query subform] = Main
+ Sub = Main (ToTal)
Total parts $ in Main + No records in [MYOB_Cards query subform] = Main
(ToTal)
No Records in Main + Total Parts $ in [MYOB_Cards query subform] = Sub =
Main (ToTal)
Hope this is not too muddy
Gaetanm
Allen said:
When there is no value to show, does the subform show a new record? Or does
it go completely blank?
If it shows a new record, you should be fine. If it goes blank, the text box
doesn't exist, and so referring to it yields #Error.
To solve that, test the RecordCount of the subform's RecordsetClone:
=IIf([MYOB_Cards query subform].[Form].[RecordsetClone].[RecordCount] =
0, 0, [MYOB_Cards query subform].[Form]![Text30])
(BTW, that expression fails in Access 2007 for some reason.)
I have a subform [MYOB_Cards query subform] in that I have a [text30]
[quoted text clipped - 16 lines]