queries and if statements

Mrs.Meeker

Registered User.
Local time
Today, 22:43
Joined
Mar 28, 2003
Messages
172
I have the following if statement

IIf(Left([tblQuestions].[PageCode],7)="General","_",Left([tblQuestions].[PageCode],InStr(1,[tblQuestions].[PageCode]," ")-1)) & Format(Mid([tblQuestions].[PageCode],InStr(1,[tblQuestions].[PageCode]," ")+1),"0000")

This works in one query (qryQCsubform) but not in another (qryStartSubReport). I have checked closely and they say exactly the same thing. (Even copied and pasted to be sure)!

I received the following error message.

This expression is typed incorrectly, or it is too complex to be evaluated. For example a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of hte expression to variables.

I don't know what to do, does anybody out there?
 
As to why this is occuring I don't know but I've had similar problems before. I would just create a new qryStartSubReport and try your "if statement" in the new one. If that doesn't work then it's beyond me. Sorry I can't be more help.
 

Users who are viewing this thread

Back
Top Bottom