Question
Reusing recordset variable parameters
Sorry for the double post guys but I've had no luck in the
general forum. Please help me find an answer to this.
--------------------------------------
I've been trying to reuse recordset variable parameters but when I try it get:
<variable>
"is an invalid variable name, it does not appear in the SQL"
Here is the SQL:
SELECT [Client Record ID], [Client Initials], Age, Sex, [Surgery AKA], [Referrer name], Comments, [Date referral made], [Counsellor First Name], [Counsellor Surname]
FROM dbo.[SYS New Referral Registration Record]
WHERE ([Client Record ID] = varClient AND [Counsellor Code] = varCounsellor) OR ([Client Record ID] = varClient AND [Owner] = varCounsellor)
.....................................
The variables are specified correctly but it won't use it more than once. When I refer to the varible once it works fine.
Any ideas???

--------------------------------------
I've been trying to reuse recordset variable parameters but when I try it get:
<variable>
"is an invalid variable name, it does not appear in the SQL"
Here is the SQL:
SELECT [Client Record ID], [Client Initials], Age, Sex, [Surgery AKA], [Referrer name], Comments, [Date referral made], [Counsellor First Name], [Counsellor Surname]
FROM dbo.[SYS New Referral Registration Record]
WHERE ([Client Record ID] = varClient AND [Counsellor Code] = varCounsellor) OR ([Client Record ID] = varClient AND [Owner] = varCounsellor)
.....................................
The variables are specified correctly but it won't use it more than once. When I refer to the varible once it works fine.
Any ideas???
