Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access 2003 #name! Error

2 views
Skip to first unread message

James

unread,
Dec 23, 2004, 3:11:01 PM12/23/04
to
I get a #name! error on my form where I have a the below code in Control
Source. I only get the error message when I am in Access 2003, but not 97,
2000, or 2002. I have only opened the file once on the 2003 machine. Is
there something that 2003 doesn't like in my code? Thank you!

---------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.

Allen Browne

unread,
Dec 23, 2004, 8:52:47 PM12/23/04
to
Steps to debug this:

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...

0 new messages