Hi

i have a form where i have 2 comboboxes and a couple of textboxes.

I have set the datasource property to the table and fields as required for all the textboxes and the combobox

The first combobox (cbCriteria) contains the column names of the table and the second combobox (cbSearchCust) contains the data in the fields which are shown according to the criteria selected from the previous combobox (Cust_id, Cust_name or Cust_sname)

I want to connect the cbSearchCust to the textboxes so that when i change the customer from the textbox, the textboxes change. How can i do this?

Thanks
Luke

Member Avatar for iamthwee

Can't you do something like:-

Dim MyVariable As String
MyVariable = ComboBox1.Text

TextBox1.Text = MyVariable

?

Thanks for your help but I managed to fix it myself.

i'm attaching the code just in case some other problem pops up you might redirect them to this thread.

write this code in the cbSearchCust_selectedindexchanged sub

me.databinding(dataset, "table").Position = cbSearchCust.selectedIndex

this code will change all your textboxes

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.