I keep getting an error when I execute this code...

Please Login or Register  to view this content.
I keep getting the error...Query too complex and when I debug this line is what is highlighted...

Please Login or Register  to view this content.
Am I missing a delcared variable?

Can somebody please assist me with resolving this error?


Thanks,
Dan