I have a textbox and 3 comboboxes in my form, what i need from this is when the user enter a value in text box (I checked if the value exist on my database or not) i need other query to returned and fill my 3 comboxes in all record information about the text box entry.

Recommended Answers

All 5 Replies

Asuming the information filling the comboboxes exists in the record from which you are searching the text in the textbox, you can do a query returning 3 vaues (one for each combobox) and assign it to each combobox.

If the comboboxes will be filled with the records thrown by the query from the text inserted in the textbox, I'd recommend filling them individually, first execute the query (and do the subsequent while loop) to fill the first combobox, then the second and then the third.

my query returned all record in the table , i need to return 1 row each time the user enter the value , what sholud my code look like

what i do is
Comm.CommandText = "SELECT ProjectTenderingNO FROM BuyNewTendering WHERE ProjectTenderingNO = '" & proTNO.Text & "'

then i bounded the combobox and wirte a select query inside add query depend on ProjectTnederingNO,

how i can do what you wirte above??

Are you allready binding the combobox from database?

yes i do

Then based on the Query result u need to set the selectedtext property of the combo..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.