I am trying to hard code the following select query into a select case statement
ie (case1 <statment>, case 2 <statment>) but I getteing Compiler error: expected line number or label, or statement or end of statement on my select [VMS-CLT] line , with and without the pertentheses at the end of my where clause. here is what I have, the query functions proporly in the access query builder.
"SELECT [VMSU-CLT].Date, [VMSU-CLT].IDNumber, [VMSU-CLT].Time," _
& " [VMSU-CLT].Correspondence Type, [VMSU-CLT].CallTakenBy, [VMSU-CLT].CallReferredTo ," _
& " [VMSU-CLT].ReasonForRefer ral, [VMSU-CLT].Caller, [VMSU-CLT].VISTALastName, " _
& " [VMSU-CLT].VISTAFirstName , [VMSU-CLT].VISTAMiddleNam e, [VMSU-CLT].State, [VMSU-CLT].ReasonForCall, " _
& "[VMSU-CLT].[CalledVia800#], [VMSU-CLT].CallFollowUp, [VMSU-CLT].CallCompletdBy " FROM [VMSU-CLT]" _
& " WHERE ((([VMSU-CLT].Date)>=[forms]![Report query]![DateFrom] And ([VMSU-CLT].Date)<=[forms]![Repor query]![DateTo])))"
ie (case1 <statment>, case 2 <statment>) but I getteing Compiler error: expected line number or label, or statement or end of statement on my select [VMS-CLT] line , with and without the pertentheses at the end of my where clause. here is what I have, the query functions proporly in the access query builder.
"SELECT [VMSU-CLT].Date, [VMSU-CLT].IDNumber, [VMSU-CLT].Time," _
& " [VMSU-CLT].Correspondence Type, [VMSU-CLT].CallTakenBy, [VMSU-CLT].CallReferredTo ," _
& " [VMSU-CLT].ReasonForRefer ral, [VMSU-CLT].Caller, [VMSU-CLT].VISTALastName, " _
& " [VMSU-CLT].VISTAFirstName , [VMSU-CLT].VISTAMiddleNam e, [VMSU-CLT].State, [VMSU-CLT].ReasonForCall, " _
& "[VMSU-CLT].[CalledVia800#], [VMSU-CLT].CallFollowUp, [VMSU-CLT].CallCompletdBy " FROM [VMSU-CLT]" _
& " WHERE ((([VMSU-CLT].Date)>=[forms]![Report query]![DateFrom] And ([VMSU-CLT].Date)<=[forms]![Repor query]![DateTo])))"
Comment