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.
|