PC Review


Reply
Thread Tools Rate Thread

Can't add to drop down

 
 
=?Utf-8?B?UGhpbCBMYW1leQ==?=
Guest
Posts: n/a
 
      1st Mar 2005
I am trying to add to the drop down list but nothing happens with this code

Dim ds As DataSet
ds = db.GetRecordset(sSQL)
drpht.DataSource = ds.Tables("table").DefaultView
drpht.DataTextField = "TN"
drpht.DataValueField = "TID"
Dim li As New ListItem
li.Value = "1000000"
li.Text = "1st Division A"
drpht.Items.Add(li)

Can anyone tell me what I am doing wrong?

Thank you,

--
Phil Lamey, EIT
CGI Consultant
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbCBMYW1leQ==?=
Guest
Posts: n/a
 
      1st Mar 2005
Doh! Rookie mistake ... I had my databind in an unfortunate spot in the code
.... IE: After I was trying to add.

I have solved this problem.

Thank you.

"Phil Lamey" wrote:

> I am trying to add to the drop down list but nothing happens with this code
>
> Dim ds As DataSet
> ds = db.GetRecordset(sSQL)
> drpht.DataSource = ds.Tables("table").DefaultView
> drpht.DataTextField = "TN"
> drpht.DataValueField = "TID"
> Dim li As New ListItem
> li.Value = "1000000"
> li.Text = "1st Division A"
> drpht.Items.Add(li)
>
> Can anyone tell me what I am doing wrong?
>
> Thank you,
>
> --
> Phil Lamey, EIT
> CGI Consultant

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert new row with drop-down box but problem with cell linkreferring to the original drop-down box Phi| Microsoft Excel Programming 2 7th Jul 2010 12:22 PM
Filtered Drop Down Menu Based on Previous Drop Down Selection Korski Microsoft Access Form Coding 1 15th Oct 2009 05:19 PM
Drag & Drop Email Message to Appt Doesn't Drop Attachment veejaycee Microsoft Outlook Calendar 2 9th Oct 2008 01:49 PM
Drop down lists that auto create and then filter the next drop down list penderyn123@googlemail.com Microsoft Excel Worksheet Functions 2 30th Sep 2007 11:53 AM
Losing drag/drop custom cursors over no drop control... Steve Rosenberry Microsoft C# .NET 0 30th Oct 2003 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:30 PM.