By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,938 Members | 2,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,938 IT Pros & Developers. It's quick & easy.

Trying to grab multiple selections from a Checkboxlist

P: n/a
Zak
Hello,

I need some help trying to grab the data selected from a checkboxlist. The
checklist is acting like a menu. The first selection is accepted but not the
multiple ones. For example is the user selects "Checked Baggage" the
selection is stored the correct procedure is processed, but if the user
selects "SIDA" along with the "Checked Baggage" there is no stored data,
just that first selection. Just the first entry is saved. Can someone help
me figure out how to get multiple selections stored so I can get this menu
to work? Thanks in advance for the assistance!

Dim item As ListItem
For Each item In cklAirportAreas.Items
If item.Selected = True Then

Select Case item.Text
Case "Checked Baggage"
CheckedBaggage = "Yes"

Case "Cargo"
Cargo = "Yes"

Case "Checkpoint"
Checkpoint = "Yes"

Case "Terminal"
Terminal = "Yes"

Case "SIDA"
SIDA = "Yes"

Case "AOA"
AOA = "Yes"

Case "Perimeter"
Perimeter = "Yes"
Case "Other"
Other = "Yes"
Case Else
MsgBox("An error has occurred please try again!")
End Select
End If

Next

Whatever is selected in from the Checkboxlist is accepted but when the
program goes to the next sections is where I get the issue:
'First button
If CheckedBaggage = "Yes" Then
plCkBaggage.Visible = True

Else
If Cargo = "Yes" Then
plCargo.Visible = True

Else
If Checkpoint = "Yes" Then
plCheckpoint.Visible = True

Else
If Terminal = "Yes" Then
plTerminal.Visible = True
Else
If SIDA = "Yes" Then
plSIDA.Visible = True
Else

If AOA = "Yes" Then
plAOA.Visible = True
Else
If Perimeter = "Yes" Then
plPerimeter.Visible = True

Else
If Other = "Yes" Then
plOther.Visible = True

End If
End If
End If
End If
End If
End If
End If
End If
End Sub

okay the program goes through this correctly but the next section, it
doesn't. I am trying to use the checkboxlist as a menu....The user selects
for example Checked Baggage, and then selects Cargo...well it goes to
Checked Baggage, the first on the list but not the next one, Cargo....here
is the code..
'Second button where there is no data....
If Cargo = "Yes" Then
plCargo.Visible = True

Else
If Checkpoint = "Yes" Then
plCheckpoint.Visible = True

Else
If Terminal = "Yes" Then
plTerminal.Visible = True
Else
If SIDA = "Yes" Then
plSIDA.Visible = True

Else

If AOA = "Yes" Then
plAOA.Visible = True
Else
If Perimeter = "Yes" Then
plPerimeter.Visible = True

Else <<<<<<<<<<For some reason instead of
going to Cargo it goes here....
If Other = "Yes" Then
plOther.Visible = True

Else
plCCTVNeeds.Visible = True

End If
End If
End If
End If
End If
End If
End If
Please help me fix this problem. Thank you.
Jun 14 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Your code will never show cargo panel if CheckedBagage item is checked.
Did you have to use "End if" instead of else in the following code:

If CheckedBaggage = "Yes" Then
plCkBaggage.Visible = True

Else
If Cargo = "Yes" Then
plCargo.Visible = True

Else
-yuriy
Hello,

I need some help trying to grab the data selected from a checkboxlist.
The checklist is acting like a menu. The first selection is accepted
but not the multiple ones. For example is the user selects "Checked
Baggage" the selection is stored the correct procedure is processed,
but if the user selects "SIDA" along with the "Checked Baggage" there
is no stored data, just that first selection. Just the first entry is
saved. Can someone help me figure out how to get multiple selections
stored so I can get this menu to work? Thanks in advance for the
assistance!

Dim item As ListItem
For Each item In cklAirportAreas.Items
If item.Selected = True Then
Select Case item.Text
Case "Checked Baggage"
CheckedBaggage = "Yes"
Case "Cargo"
Cargo = "Yes"
Case "Checkpoint"
Checkpoint = "Yes"
Case "Terminal"
Terminal = "Yes"
Case "SIDA"
SIDA = "Yes"
Case "AOA"
AOA = "Yes"
Case "Perimeter"
Perimeter = "Yes"
Case "Other"
Other = "Yes"
Case Else
MsgBox("An error has occurred please try again!")
End Select
End If
Next

Whatever is selected in from the Checkboxlist is accepted but when the
program goes to the next sections is where I get the issue:
'First button
If CheckedBaggage = "Yes" Then
plCkBaggage.Visible = True
Else
If Cargo = "Yes" Then
plCargo.Visible = True
Else
If Checkpoint = "Yes" Then
plCheckpoint.Visible = True
Else
If Terminal = "Yes" Then
plTerminal.Visible = True
Else
If SIDA = "Yes" Then
plSIDA.Visible = True
Else
If AOA = "Yes" Then
plAOA.Visible = True
Else
If Perimeter = "Yes" Then
plPerimeter.Visible = True
Else
If Other = "Yes" Then
plOther.Visible = True
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
okay the program goes through this correctly but the next section, it
doesn't. I am trying to use the checkboxlist as a menu....The user
selects
for example Checked Baggage, and then selects Cargo...well it goes to
Checked Baggage, the first on the list but not the next one,
Cargo....here
is the code..
'Second button where there is no data....
If Cargo = "Yes" Then
plCargo.Visible = True
Else
If Checkpoint = "Yes" Then
plCheckpoint.Visible = True
Else
If Terminal = "Yes" Then
plTerminal.Visible = True
Else
If SIDA = "Yes" Then
plSIDA.Visible = True
Else

If AOA = "Yes" Then
plAOA.Visible = True
Else
If Perimeter = "Yes" Then
plPerimeter.Visible = True
Else <<<<<<<<<<For some reason instead
of
going to Cargo it goes here....
If Other = "Yes" Then
plOther.Visible = True
Else
plCCTVNeeds.Visible = True
End If
End If
End If
End If
End If
End If
End If
Please help me fix this problem. Thank you.

Jun 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.