A
Afrosheen via AccessMonster.com
Hello and thanks for reading this.
I have two case statements that are basically the same. I would like to
consolidate them in to one if I can.
Select Case flg
Case "Work Plans"
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False"
End Select
The second case statement is just about the same.
Select Case flg
Case "Work Plans"
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False" & _
" AND qryTaps.Supervisor=""" & Me.cboloc & """"
End Select
The only difference between the two is after the Archive = False etc.
I tried using the if then statement like below, but when I followed the code
it jumped right over it.
head1 = "True"
Select Case flg
Case "Work Plans"
If head1 = "True" Then
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False"
Else
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False" & _
" AND qryTaps.Supervisor=""" & Me.cboloc & """"
End If
I can use the two case statements if I have to but I'd like to combine them
if possible to save space and have the prg run more efficiently.
Any suggestions would be appreciated.
I have two case statements that are basically the same. I would like to
consolidate them in to one if I can.
Select Case flg
Case "Work Plans"
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False"
End Select
The second case statement is just about the same.
Select Case flg
Case "Work Plans"
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False" & _
" AND qryTaps.Supervisor=""" & Me.cboloc & """"
End Select
The only difference between the two is after the Archive = False etc.
I tried using the if then statement like below, but when I followed the code
it jumped right over it.
head1 = "True"
Select Case flg
Case "Work Plans"
If head1 = "True" Then
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False"
Else
strWhere = "qryTaps.WorkPlan=""" & strMon & _
""" AND qryTaps.Archive=False" & _
" AND qryTaps.Supervisor=""" & Me.cboloc & """"
End If
I can use the two case statements if I have to but I'd like to combine them
if possible to save space and have the prg run more efficiently.
Any suggestions would be appreciated.