PC Review


Reply
Thread Tools Rate Thread

ComboBox Text property

 
 
Graeme Richardson
Guest
Posts: n/a
 
      30th Aug 2003
Hi, how can I get the Text value of a ComboBox when I type a new value into
it while the list is open?
I'm trapping the Validated event.
If I type a new value with the ComboBox closed then everything works. I.e. I
check the ComboBox.Text property and receive the new value.
However, if I show the list and type a new value then the ComboBox.Text
property returns the previously selected value.

This is the code I use to fill the ComboBox (uidTown is an unseen primary
key and Town is the visible value):

Public Sub fill(ByRef rcboTown As ComboBox)

Dim CTownObjects As clsTownObjects
Dim cmdTown As OleDbCommand
Dim dsTown As DataSet
Dim adpTown As OleDbDataAdapter

CTownObjects = New clsTownObjects(mcnnConnection)
cmdTown = CTownObjects.SelectCommand()

dsTown = New DataSet("tlkpTown")

adpTown = New System.Data.OleDb.OleDbDataAdapter
adpTown.SelectCommand = cmdTown
adpTown.Fill(dsTown, "tlkpTown")

rcboTown.Items.Clear()
rcboTown.DataSource = dsTown.Tables("tlkpTown")
rcboTown.ValueMember = "uidTown"
rcboTown.DisplayMember = "Town"

End Sub

Thanks for any help you can offer, Graeme.


 
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
RE: Could not set the Text property of a ComboBox on User Form. =?Utf-8?B?Sm9obiBCdW5keQ==?= Microsoft Excel Programming 0 11th Dec 2006 11:58 PM
Cont' Value and Text Property of Combobox =?Utf-8?B?YXVndXN0dXM=?= Microsoft Excel Programming 0 1st Nov 2004 10:18 PM
Re: Is a bug (Text Property of Combobox)? (now, with the code...hehehe) Svein Terje Gaup Microsoft Dot NET Framework 0 12th May 2004 09:28 PM
Is a bug (Text Property of Combobox)? Wagner Microsoft Dot NET Framework 2 28th Apr 2004 03:34 PM
ComboBox Text property (repost) Graeme Richardson Microsoft Dot NET Framework Forms 1 3rd Sep 2003 11:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:51 AM.