Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expression

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,965
US
Could you tell me why this expression works in Access 97 but not in Access 2003?

=IIf([Forms]![Job File]![JOB ITEMS Query].[Form].[RecordsetClone].[RecordCount]=0,0,[Forms]![Job File]![JOB ITEMS Query]![TxtExtended])

I know it has something to do with the [RecordsetClone].[RecordCount] property, but I tried everything and still it returns the #Name? value. Thanks.

Swi
 
Luck? I'm honestly surprised it has ever worked in any version.

Off the top of my head I think you probably should use the dcount function instead or put it in a function and return the result.

The other possiblity is the recordset may be ADO instad of DAO... I lost track of how that worked along the way.
 
Yes SWi, I agree with LameID, i'm amazed the recordset & count property EVER worked. All the same. excuse the obvious but "Job File" & "JOB ITEMS Query" forms, must be open. (assuming parent & child form) Is the control holding this expression, located on either form/subform?
All the same, i question if one is able to use any Form properties in a control expression (outside of collection properties)??
 
How are ya Swi . . .

I can't say why it worked in 97, but if we take a look only at the form references the problem is clear:
Code:
[blue]   [Forms]![Job File]![JOB ITEMS Query].[Form]        [green]'proper form reference[/green]
   [Forms]![Job File]![JOB ITEMS Query]![TxtExtended] [red]'improper form reference[/red][/blue]
Once the faulty form reference is fixed were left with a [blue]completely legitmate[/blue] IIf function! [thumbsup2]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 

So what happen to [blue]Swi[/blue]? ... [surprise]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top