OK, Only the code from zfm Main would fit in the first reply. Here's the
code from the subform subfmMainE.
Again, please don't laugh...I know not what I do!
ON SUBFORM subfmMainE
Private Sub lblEc1_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 1 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.ClientID;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.ClientID DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.ClientID;"
Me.txtEcECo = 1
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = True
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc2_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 2 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientOL.[File As];"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientOL.[File As] DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientOL.[File As];"
Me.txtEcECo = 2
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = True
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc3_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 3 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.EngagementID;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.EngagementID DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.EngagementID;"
Me.txtEcECo = 3
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = True
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc4_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 4 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.EngagementYr;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.EngagementYr DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.EngagementYr;"
Me.txtEcECo = 4
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = True
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc5_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 6 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.CEStaffID;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.CEStaffID DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.CEStaffID;"
Me.txtEcECo = 6
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = True
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc7_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 7 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.CEDueDateI;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.CEDueDateI DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.CEDueDateI;"
Me.txtEcECo = 7
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = True
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc8_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 8 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY ClientEngagement.CEBudgetHrs;"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY ClientEngagement.CEBudgetHrs DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY ClientEngagement.CEBudgetHrs;"
Me.txtEcECo = 8
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = True
Me.lblEc9.FontBold = False
End Sub
Private Sub lblEc9_Click()
Dim stSQLsource As String
Dim lngSQLpos As Long
Dim stSQL1 As String
Dim stSQL2 As String
Dim stSQL As String
stSQLsource = lstECsubEc.RowSource
lngSQLpos = InStr(1, stSQLsource, "ORDER BY")
stSQL1 = Left(stSQLsource, (lngSQLpos - 1))
If Me.txtEcECo = 9 Then
If Me.txtEcECs = "d" Then
stSQL2 = "ORDER BY
IIf([CAHold]=-1,'Hold',IIf([CAComplete]=-1,'Complete',' -'));"
Me.txtEcECs = "a"
ElseIf Me.txtEcECs = "a" Then
stSQL2 = "ORDER BY
IIf([CAHold]=-1,'Hold',IIf([CAComplete]=-1,'Complete',' -')) DESC;"
Me.txtEcECs = "d"
End If
Else
stSQL2 = "ORDER BY
IIf([CAHold]=-1,'Hold',IIf([CAComplete]=-1,'Complete',' -'));"
Me.txtEcECo = 9
Me.txtEcECs = "a"
End If
stSQL = stSQL1 & stSQL2
Me.lstECsubEc.RowSource = stSQL
Me.lblEc1.FontBold = False
Me.lblEc2.FontBold = False
Me.lblEc3.FontBold = False
Me.lblEc4.FontBold = False
Me.lblEc5.FontBold = False
Me.lblEc7.FontBold = False
Me.lblEc8.FontBold = False
Me.lblEc9.FontBold = True
End Sub
Private Sub tglECComplete_AfterUpdate()
TglECFunction
End Sub
Private Sub tglECHold_AfterUpdate()
TglECFunction
End Sub
Private Sub tglECOpen_AfterUpdate()
TglECFunction
End Sub
Private Sub TglECFunction()
Dim stSQLs As String
Dim stSQLf As String
Dim stSQLw1 As String
Dim stSQLw2 As String
Dim stSQLo As String
Dim stSQL As String
Dim intTglECSum As Integer
Dim intTglECOpen As Integer
Dim intTglECHold As Integer
Dim intTglECComplete As Integer
intTglECOpen = -2
intTglECHold = -4
intTglECComplete = -8
intTglECSum = (Me.tglECOpen * intTglECOpen) + (Me.tglECHold *
intTglECHold) + (Me.tglECComplete * intTglECComplete)
stSQLf = "FROM (Client INNER JOIN ClientOL ON Client.ClientID =
ClientOL.[User Field 1]) " & _
"INNER JOIN ClientEngagement ON Client.ClientID =
ClientEngagement.ClientID "
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw1 = ""
Else
stSQLw1 = "WHERE ((ClientEngagement.EngagementID) =
[Forms]![zfmMain]![lstEMainE]) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw1 = "WHERE ((ClientEngagement.CEInactive) = True) "
Else
stSQLw1 = "WHERE ((ClientEngagement.EngagementID) =
[Forms]![zfmMain]![lstEMainE]) "
End If
End Select
Select Case Me.txtEcECo
Case 1
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.ClientID;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.ClientID DESC;"
End Select
Case 2
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientOL.[File As];"
Case "d"
stSQLo = "ORDER BY ClientOL.[File As] DESC;"
End Select
Case 3
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.EngagementID;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.EngagementID DESC;"
End Select
Case 4
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.EngagementYr;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.EngagementYr DESC;"
End Select
Case 6
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.CEStaffID;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.CEStaffID DESC;"
End Select
Case 7
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.CEDueDateI;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.CEDueDateI DESC;"
End Select
Case 8
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY ClientEngagement.CEBudgetHrs;"
Case "d"
stSQLo = "ORDER BY ClientEngagement.CEBudgetHrs DESC;"
End Select
Case 9
Select Case Me.txtEcECs
Case "a"
stSQLo = "ORDER BY
IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -'));"
Case "d"
stSQLo = "ORDER BY
IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) DESC;"
End Select
End Select
Select Case intTglECSum
Case 0
stSQLs = ""
stSQLf = ""
stSQLw1 = ""
stSQLw2 = ""
stSQLo = ""
Case 2
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE ((ClientEngagement.CEHold) = False)
AND ((ClientEngagement.CEComplete) = False) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) =
False) AND ((ClientEngagement.CEComplete) = False) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND ((ClientEngagement.CEHold) = False)
AND ((ClientEngagement.CEComplete) = False) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) =
False) AND ((ClientEngagement.CEComplete) = False) "
End If
End Select
Case 4
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE ((ClientEngagement.CEHold) = True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) =
True) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND ((ClientEngagement.CEHold) = True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) =
True) "
End If
End Select
Case 6
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE (((ClientEngagement.CEHold) = True)
OR ((ClientEngagement.CEComplete) = False)) "
Else
stSQLw2 = "AND (((ClientEngagement.CEHold) =
True) OR ((ClientEngagement.CEComplete) = False)) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND (((ClientEngagement.CEHold) = True)
OR ((ClientEngagement.CEComplete) = False)) "
Else
stSQLw2 = "AND (((ClientEngagement.CEHold) =
True) OR ((ClientEngagement.CEComplete) = False)) "
End If
End Select
Case 8
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE ((ClientEngagement.CEComplete) =
True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEComplete) =
True) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND ((ClientEngagement.CEComplete) =
True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEComplete) =
True) "
End If
End Select
Case 10
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE ((ClientEngagement.CEHold) <> True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) <>
True) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND ((ClientEngagement.CEHold) <> True) "
Else
stSQLw2 = "AND ((ClientEngagement.CEHold) <>
True) "
End If
End Select
Case 12
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "WHERE (((ClientEngagement.CEHold) = True)
OR ((ClientEngagement.CEComplete) = True)) "
Else
stSQLw2 = "AND (((ClientEngagement.CEHold) =
True) OR ((ClientEngagement.CEComplete) = True)) "
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = "AND (((ClientEngagement.CEHold) = True)
OR ((ClientEngagement.CEComplete) = True)) "
Else
stSQLw2 = "AND (((ClientEngagement.CEHold) =
True) OR ((ClientEngagement.CEComplete) = True)) "
End If
End Select
Case 14
If Form_zfmMain.lstEMainE = "*" Then
stSQLs = "SELECT ClientEngagement.ClientID, ClientOL.[File
As], ClientEngagement.EngagementID, ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, " & _
"ClientEngagement.CEBudgetHrs, IIf([CEHold]=-1,'
Hold',IIf([CEComplete]=-1,'Complete',' -')) AS calcCEStatus "
Me.lblEc3.Visible = True
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 9
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.4in;0.65in;0.5in;0.5in;0.5in;0.65in"
Else
stSQLs = "SELECT ClientEngagement.ClientID,
ClientOL.[File As], ClientEngagement.EngagementYr, " & _
"ClientEngagement.CEStaffID,
ClientEngagement.CEDueDateI, ClientEngagement.CEBudgetHrs, " & _
"IIf([CEHold]=-1,'Hold',IIf([CEComplete]=-1,'Complete',' -')) AS
calcCEStatus "
Me.lblEc3.Visible = False
Me.lblEc7.Caption = "DueDate"
Me.lblEc8.Caption = "BudgetHrs"
Me.lstECsubEc.ColumnCount = 8
Me.lstECsubEc.ColumnWidths =
"0.65in;2.25in;0.65in;0.4in;0.65in;0.65in;0.65in;0.65in"
End If
Select Case Form_zfmMain.tglEInactive
Case False
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = ""
Else
stSQLw2 = ""
End If
Case True
If Form_zfmMain.lstEMainE = "*" Then
stSQLw2 = ""
Else
stSQLw2 = ""
End If
End Select
Case 1
Case 2
End Select
stSQL = stSQLs & stSQLf & stSQLw1 & stSQLw2 & stSQLo
Me.lstECsubEc.RowSource = stSQL
Me.Refresh
End Sub