• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

MS Access help please

DAGTA

Diamond Member
Oct 9, 1999
8,172
1
0
I'm working with an Access 97 database and trying to add this expression to a field on a report:

href: IIf(IsNull([www address]) Or Trim([www address])="","",IIf(left([www address], 7) = "http://", "<a href=" & [www address] & ">" & [www address] & "</a>", "<a href=http://" & [www address] & ">http://" & [www address] & "</a>"))

It looks correct to me and other people I have asked but every time I try and preview the report I get an error saying there is an extra ')' in the expression.

Any help would be GREATLY appreciated as I'm pulling my hair out on this one.
Thanks,
-DAGTA
 

UThomas

Senior member
Apr 18, 2000
251
0
0
Try using the switch command, that iif is extremely slow when you nest it. Do a "help" and search for "switch."

Its much better.

Thomas
 

SQL

Member
Jul 10, 2001
115
0
0
Perhaps I'm misunderstanding you but in reports the href: thing won't work.

For a control on a report you'd want =iif(blah blah blah) instead of href: iif(blah blah blah)

href: iif () works ok as calculated fields in queries. I tried this out on a report, and got the extra ) error when I pasted your expression in. Changing the href: to = solved the error message.