IIf Statement

T

Tony Williams

Can someone tell me why I'm getting #Name in the form control with this
formula?
=IIf([Projects Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Projects
Subform].[Form]![TotaldaysWorked])
I'm using Access 2003
Thanks
Tony
 
T

Tony Williams

Rick this is a database using the Microsoft template for Time and Billing?
It's their code. Any suggestions as to how I could change it?
Thanks
Tony
Rick Brandt said:
Tony said:
Can someone tell me why I'm getting #Name in the form control with
this formula?
=IIf([Projects
Subform].[Form].[RecordsetClone].[RecordCount]=0,0,[Projects
Subform].[Form]![TotaldaysWorked]) I'm using Access 2003
Thanks
Tony


RecordSetClone can ONLY be referenced in VBA, not in a ControlSource
expression. From the Help file...

The RecordsetClone property setting is a copy of the underlying query or
table specified by the form's RecordSource property. If a form is based on
a query, for example, referring to the RecordsetClone property is the
equivalent of cloning a Recordset object by using the same query. If you
then apply a filter to the form, the Recordset object reflects the
filtering.

This property is available only by using Visual Basic and is read-only in
all views.
 
T

Tony Williams

Sorry to be so pedantic Rick and I know if it's wrong it's wrong, but as I
said that is the statement that is shown in the source line of the control
of a form that is part of Microsoft's Time and Billing template how could
they get it wrong? In fact it appears in about three different controls.
Funny thing is it works in Access 2000 but doesn't in Access 2003? Odd?
Tony
 
R

Rick Brandt

Tony said:
Sorry to be so pedantic Rick and I know if it's wrong it's wrong, but
as I said that is the statement that is shown in the source line of
the control of a form that is part of Microsoft's Time and Billing
template how could they get it wrong? In fact it appears in about
three different controls. Funny thing is it works in Access 2000 but
doesn't in Access 2003? Odd? Tony

It's possible that the "only available in code" was changed in later versions.
I was quoting the Access 97 help file.
 

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