|
-
Jun 17th, 2005, 11:33 AM
#1
Thread Starter
Lively Member
Selecting Listbox Item Based On Textbox.Text Value - MORE INFO
Anybody have any idea how to select a listbox item to equal the text value in a textbox? My aim is to already have the Customer selected in the ListBox when they go to the next tab. I'm thinking maybe this needs to be done in a TabIndexChanged event or something.
I've tried :
VB Code:
lbxRecCust.SelectedItem.Item(0)=txtCustomerName.Text
lbxRecCust.SelectedValue = txtCustomerName.Text
lbxRecCust.SelectedIndex=txtCustomerName.Text
And a couple of others...not sure how to handle this here.
MORE INFO - When I used the first option, it does not select the item, and when I manually select an item, I get an error that highlights my sql statement that fills in the partnumber listbox (from yesterday's discussion), and gives me a System.NullReferenceException (object reference not set...)
Last edited by milkmood; Jun 17th, 2005 at 11:43 AM.
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
-
Jun 17th, 2005, 11:48 AM
#2
Lively Member
Re: Selecting Listbox Item Based On Textbox.Text Value - MORE INFO
It seems like your second option should work. If you are using a dataset, do you have the ValueMember property of the listbox set?
-
Jun 17th, 2005, 12:02 PM
#3
Thread Starter
Lively Member
Re: Selecting Listbox Item Based On Textbox.Text Value - MORE INFO
I am not using a ValueMember property. There are none available. I'm doing all the db stuff manually.
When I say 'jump', don't waste time asking 'how high?'.

Just a poor, dumb wanna-be programmer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|