Calculation not working in A2007

P

Phil

Hi

I have just moved over to A2007, I have adatabase that worked fine in 2000,
and 2003 on a form in the control source I have the calculation

=[AvailableSpaces]-IIf([Events
Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Events
Subform].[Form]![Total Attendees])

Which just returns #Name?

As I said this worked fine in 2003, is there any reason it doesnt work now?

Thanks

Phil
 
J

Jeff Boyce

Phil

"#Name" is Access' way of saying "I don't find anything spelled that way".

This can happen when a reference is mispelled, or leaves something out.

I wonder if you added in the main form's name in front of your "[Events
Subform]..."? Something like:

Forms!YourMainForm![Events Subform]!...

(by the way, the bang ("!") more properly is used for
collections/user-defined objects. You might want to check the syntax...)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
P

Phil

Hi Jeff

Thanks for your reply

I tried
=[AvailableSpaces]-IIf([Forms]![Events]![Events
Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Forms]![Events]![Events
Subform].[Form].[Total Attendees])

Not sure if that was what you meant, but I still get the same result. The
previous worked fine under 2000/2003 it is only 2007 that does not like it??

Thanks

Phil


Jeff Boyce said:
Phil

"#Name" is Access' way of saying "I don't find anything spelled that way".

This can happen when a reference is mispelled, or leaves something out.

I wonder if you added in the main form's name in front of your "[Events
Subform]..."? Something like:

Forms!YourMainForm![Events Subform]!...

(by the way, the bang ("!") more properly is used for
collections/user-defined objects. You might want to check the syntax...)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Phil said:
Hi

I have just moved over to A2007, I have adatabase that worked fine in
2000,
and 2003 on a form in the control source I have the calculation

=[AvailableSpaces]-IIf([Events
Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Events
Subform].[Form]![Total Attendees])

Which just returns #Name?

As I said this worked fine in 2003, is there any reason it doesnt work
now?

Thanks

Phil


.
 
A

AccessVandal via AccessMonster.com

Maybe it should be

[Forms]![Events Subform].[Form].[RecordsetClone].[RecordCount]
and
[Forms]![Events Subform].[Form].[Total Attendees]

instead of your original

[Events Subform].[Form].[RecordsetClone].[RecordCount]
and
[Events Subform].[Form]![Total Attendees])
Hi Jeff

Thanks for your reply

I tried
=[AvailableSpaces]-IIf([Forms]![Events]![Events
Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Forms]![Events]![Events
Subform].[Form].[Total Attendees])

Not sure if that was what you meant, but I still get the same result. The
previous worked fine under 2000/2003 it is only 2007 that does not like it??

Thanks

Phil
[quoted text clipped - 35 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top