473,322 Members | 1,401 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,322 software developers and data experts.

unselectable datacombo

I've got a data combo with about 12 rows, of which only the first two
are selectable!

I put a label on the page below the datacombo and selecteditem.text
will populate the list when I change the selection combo for either of
the first two items, but not for any of the others.

I'm using database objects to populate the Datacombo.

The code is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

If Not IsPostBack Then
odaParam.Fill(DsParam2)
cmbParam.DataBind()
End If
End Sub

Private Sub cmbParam_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cmbParam.SelectedIndexChanged

Label1.Text = cmbParam.SelectedItem.Text

End Sub

The HTML is:
<P>
<select name="cmbParam" onchange="__doPostBack('cmbParam','')"
language="javascript" id="cmbParam">
<option value="0"> Select..</option>
<option value="S">Body Location</option>
<option value="S">Evaluation</option>
<option value="S">Feature</option>
<option value="S">Period</option>
<option value="0">Primary Location</option>
<option value="0">Repetition</option>
<option value="0">Season</option>
<option value="S">Sensation</option>
<option value="0">Shave</option>
<option value="S">Site</option>
<option value="S">Skin Type</option>
<option value="0">Subject</option>
<option value="0">Tan</option>

</select></P>

Nov 19 '05 #1
2 1417
a select posts back the selected value, not the index, so in your case it
eithe '0' or 'S', wich always matches one of the first two selections. you
need unique values for each selection.

-- bruce (sqlwork.com)

"oaksong" <oa*****@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I've got a data combo with about 12 rows, of which only the first two
are selectable!

I put a label on the page below the datacombo and selecteditem.text
will populate the list when I change the selection combo for either of
the first two items, but not for any of the others.

I'm using database objects to populate the Datacombo.

The code is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

If Not IsPostBack Then
odaParam.Fill(DsParam2)
cmbParam.DataBind()
End If
End Sub

Private Sub cmbParam_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cmbParam.SelectedIndexChanged

Label1.Text = cmbParam.SelectedItem.Text

End Sub

The HTML is:
<P>
<select name="cmbParam" onchange="__doPostBack('cmbParam','')"
language="javascript" id="cmbParam">
<option value="0"> Select..</option>
<option value="S">Body Location</option>
<option value="S">Evaluation</option>
<option value="S">Feature</option>
<option value="S">Period</option>
<option value="0">Primary Location</option>
<option value="0">Repetition</option>
<option value="0">Season</option>
<option value="S">Sensation</option>
<option value="0">Shave</option>
<option value="S">Site</option>
<option value="S">Skin Type</option>
<option value="0">Subject</option>
<option value="0">Tan</option>

</select></P>

Nov 19 '05 #2
Ok. I was missing the part about what was being posted back, but I
finally managed to finally figure that part out. I'm appending the Text
to the Value to get a unique. Not pretty, but gets me to where I want
to go.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hmmm... | last post by:
Is there a way to control which controls appear to be "on top". For example a MaskEdBox shows up "on top" of a ComboBox when the 2 controls overlap, but a MaskedBox shows up "underneath" a...
2
by: Nick | last post by:
Is it possible through css to make an element in a multiple list menu unselectable. Im organizing my list by using titles... +-------------+ | CATEGORY 1 | | option 1 | | option 2 | | ...
0
by: eye5600 | last post by:
In the form designer, a ComboBox on a TabPage becomes unselectable via the mouse. (Any attempt to interact with the ComboBox via mouse selects the TabPage) I can select something else, and tab to...
0
by: oaksong | last post by:
I've got a data combo with about 12 rows, of which only the first two are selectable! I put a label on the page below the datacombo and selecteditem.text will populate the list when I change the...
6
by: R | last post by:
Hi, I'm really stuck here. I have a data combo called cmbHvem which I link to a recordset RS23 like this If RS23.State = adStateOpen Then cmbHvem.RowSource = Nothing RS23.Close() End If
1
by: Bookreader | last post by:
I'm using a datacombo box in an application. It works fine when someone has made a selction and I use: adodcClient.Recordset.Bookmark = dcClient.SelectedItem MsgBox "Client Selected: " &...
0
by: Akinyemi | last post by:
I am developing a database for a Payroll program. I store the names of employees in a DataCombo control. I use ADO to connect the fields to my Access Database. Instead of using a Find or Search...
1
by: Garg | last post by:
Hi All, I am facing a technical problem. I have craeated one form and in that I have a table. in that table user can select a row and by using shift key user can select multiple rows. this i did...
1
by: hussainiyad | last post by:
Dear All, In my form i,v many tables for examples 1.(Table)supplier = SupId varchar(10) primary key,SupName(20) 2.(Table)Product = ItemNo varchar(10)Primary key,Descrp varchar(20),Price...
1
by: sunilkds | last post by:
What is difference between datacombo box and simple combo box. what is combox.itemdata @ datacombo box I want complete information with example of datacombo box
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.