I am scratching my head on this syntax. I am declaring strType to be one of three options. Then the variable strType will factor into the embedded query: strSQL. I would appreciate any assistance in this syntax issue. TY.
Dim strType As String
If strType = "Single Family" Then
strType = "SF"
ElseIf strType = "Multi Family" Then
strType = "MF"
ElseIf strType = "All" Then
strType = vbNullString
End If
If Len(strType) > 0 Then
strType = " AND (tblMainDetail.Type='" & strType & "')"
End If
strSQL = "SELECT...
"FROM...
"GROUP BY...
"HAVING (((qryNat_Chart.DateYr)=Year(Date())) AND ((qryNat_Chart.DateQtr)=Val(Format(Date(),""q""))-1) & strType & ""))" & vbCrLf & _
"ORDER BY
Dim strType As String
If strType = "Single Family" Then
strType = "SF"
ElseIf strType = "Multi Family" Then
strType = "MF"
ElseIf strType = "All" Then
strType = vbNullString
End If
If Len(strType) > 0 Then
strType = " AND (tblMainDetail.Type='" & strType & "')"
End If
strSQL = "SELECT...
"FROM...
"GROUP BY...
"HAVING (((qryNat_Chart.DateYr)=Year(Date())) AND ((qryNat_Chart.DateQtr)=Val(Format(Date(),""q""))-1) & strType & ""))" & vbCrLf & _
"ORDER BY