|
Re: VBA Check Box
Yes it's possible, but I'm struggling with the info you've provided to give you a solution. I think you want somthing like:
strSQL = strSQL & _
"WHERE qrySchoolRecordProgrammes.SchoolIDX IN (" & trSelectedSchools & ")" & _
" AND qrySchoolRecordProgrammes.FormIDX IN (" & strSelectedForms ")" & _
" AND qrySchoolRecordProgrammes.SchoolYear IN (" & strSelectedSchoolYears & ")" & _
" AND qrySchoolRecordProgrammes.EventIDX IN (" & strSelectedEP & ")" & _
" AND " & IIf(chkDroppedOut, "", "NOT ") & _
" ( qrySchoolRecordProgrammes.SchoolDroppedOut = 1 OR " & _
" qrySchoolRecordProgrammes.SchoolDroppedOut = 4 ) " & _
...but since I don't know what the 3 and 255 refer to exactly it's difficultt o be sure - you may well need to add the 255 line back in at least:
strSQL = strSQL & _
"WHERE qrySchoolRecordProgrammes.SchoolIDX IN (" & trSelectedSchools & ")" & _
" AND qrySchoolRecordProgrammes.FormIDX IN (" & strSelectedForms ")" & _
" AND qrySchoolRecordProgrammes.SchoolYear IN (" & strSelectedSchoolYears & ")" & _
" AND qrySchoolRecordProgrammes.EventIDX IN (" & strSelectedEP & ")" & _
" AND " & IIf(chkDroppedOut, "", "NOT ") & _
" ( qrySchoolRecordProgrammes.SchoolDroppedOut = 1 OR " & _
" qrySchoolRecordProgrammes.SchoolDroppedOut = 4 OR " & _
" qrySchoolRecordProgrammes.SchoolDroppedOut = 255 ) " & _
I'm also wary as the string clearly continues after what you've shown and without knowing what comes next it's difficult to be sure this is right.
|