User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,195 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 1820 | Replies: 2
Reply
Join Date: Oct 2006
Posts: 14
Reputation: lukis is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
lukis lukis is offline Offline
Newbie Poster

combobox control

  #1  
May 7th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 4,832
Reputation: iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light 
Rep Power: 17
Solved Threads: 324
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: combobox control

  #2  
May 7th, 2007
Can't you do something like:-

Dim MyVariable As String
MyVariable = ComboBox1.Text

TextBox1.Text = MyVariable
?
... the hat of 'is this a cat in a hat?'
Reply With Quote  
Join Date: Oct 2006
Posts: 14
Reputation: lukis is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
lukis lukis is offline Offline
Newbie Poster

Re: combobox control

  #3  
May 8th, 2007
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 3:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC