473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Trying to grab multiple selections from a Checkboxlist

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
1 1986
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: theoryboy | last post by:
I'm trying to implement multiple selection functionality in a Tix Hlist using a control-click. I've bound control-click to a function that uses selection_set to add to the selection, but it doesn't...
1
by: jeffgeorge | last post by:
Trying to create multiple acct reports based on the selection in a list box. I've set the list box for multiple selections, and in the report data source, I have a SQL statement which is reading...
2
by: Craig B. | last post by:
I am relativly new to access 2000 and am having some trouble with a report. I am not sure what I want to do is something I can do in access. I want to be able to choose from a combo box multiple...
0
by: gabe_pu | last post by:
List Box Multiple Selections I have a list box on my page and I´m trying to add new items on it. The insert operation must be under the selected item. When I make the insertion it is done ...
2
by: John Hoge | last post by:
I'm looking for that elusive .net time saving magic. I have an application that presents a list of items which the user can select from. A CheckBoxList works great for that, but I want to query...
2
by: Steffen Loringer | last post by:
Hi all, may be an easy question: How can I allow multiple selections in a dropdownlist? Thanks Steffen
4
by: tbayse | last post by:
Hello, I have a question about making multiple selection queries in Access. I am running windows XP and Access 2003. Up until this point I had a form where a user would make single selections from...
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
0
by: Germaris | last post by:
Hi there! Is it possible to make multiple selections in a ComboBox ? i.e. make n consecutive selections and store them in an array or make n selections in the open list of the CB by using (for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.