H
Heather
I need to display the result in SQLWhere in this section
into a Status sheet in my workbook and thought I should
somehow do this at the end of this routine but the problem
is that I need to display GroupID in one column and
ClassId in another etc.... and the message box doesn't
display it like that... Can someone please help me adjust
this code to be able to put the result of this into a
worksheet????? I really need this by tomorrow if at all
possible... They can have for ex. 1 groupID and 5
Classid's.. THANK YOU, THANK YOU!!!!
Public Sub CommandButtonNextGroupId_Click()
Dim i As Integer
Dim j As Integer
GroupCnt = GroupCnt + 1
If GroupCnt > 1 Then SQLWhere = SQLWhere + " Or "
SQLWhere = SQLWhere + "(GroupId = '" +
InputForm.GroupIdInput + "' "
InputForm.GroupIdInput.Value = ""
' Clear ListBoxClass
j = 0
For i = 0 To intNumReturnedC - 1
If InputForm.ListBoxClass.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And ClassId in
("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" +
InputForm.ListBoxClass.List(0, 0) + "'"
End If
InputForm.ListBoxClass.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
' Clear ListBoxPlan
j = 0
For i = 0 To intNumReturnedP - 1
If InputForm.ListBoxPlan.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And PlanId in ("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" + RTrim
(InputForm.ListBoxPlan.List(0, 0)) + "'"
End If
InputForm.ListBoxPlan.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
' Clear ListBoxBusCat
j = 0
For i = 0 To intNumReturnedB - 1
If InputForm.ListBoxBusCat.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And BusCat in ("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" +
InputForm.ListBoxBusCat.List(0, 0) + "'"
End If
InputForm.ListBoxBusCat.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
SQLWhere = SQLWhere + ") "
MsgBox SQLWhere
End Sub
into a Status sheet in my workbook and thought I should
somehow do this at the end of this routine but the problem
is that I need to display GroupID in one column and
ClassId in another etc.... and the message box doesn't
display it like that... Can someone please help me adjust
this code to be able to put the result of this into a
worksheet????? I really need this by tomorrow if at all
possible... They can have for ex. 1 groupID and 5
Classid's.. THANK YOU, THANK YOU!!!!
Public Sub CommandButtonNextGroupId_Click()
Dim i As Integer
Dim j As Integer
GroupCnt = GroupCnt + 1
If GroupCnt > 1 Then SQLWhere = SQLWhere + " Or "
SQLWhere = SQLWhere + "(GroupId = '" +
InputForm.GroupIdInput + "' "
InputForm.GroupIdInput.Value = ""
' Clear ListBoxClass
j = 0
For i = 0 To intNumReturnedC - 1
If InputForm.ListBoxClass.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And ClassId in
("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" +
InputForm.ListBoxClass.List(0, 0) + "'"
End If
InputForm.ListBoxClass.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
' Clear ListBoxPlan
j = 0
For i = 0 To intNumReturnedP - 1
If InputForm.ListBoxPlan.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And PlanId in ("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" + RTrim
(InputForm.ListBoxPlan.List(0, 0)) + "'"
End If
InputForm.ListBoxPlan.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
' Clear ListBoxBusCat
j = 0
For i = 0 To intNumReturnedB - 1
If InputForm.ListBoxBusCat.Selected(0) = True Then
j = j + 1
If j = 1 Then SQLWhere = SQLWhere + "And BusCat in ("
If j > 1 Then SQLWhere = SQLWhere + ", "
SQLWhere = SQLWhere + "'" +
InputForm.ListBoxBusCat.List(0, 0) + "'"
End If
InputForm.ListBoxBusCat.RemoveItem 0
Next
If j > 0 Then SQLWhere = SQLWhere + ") "
SQLWhere = SQLWhere + ") "
MsgBox SQLWhere
End Sub