|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Tad bit of combo box newbie help, please!I know I should have been able to find this in a book or in this or
another group, but I've been looking for hours and trying to get it to work for hours, but my mind is just not getting around this thing. I'm using VB.NET 2005 The setup is very simple. I have an Access db with one table (tblCar) containing three fields (CarID, CarName, CarDesc). At formload, I successfully pull all records for all fields and populate the form, txtCarID, cboCarName and rtfCarDec all show the info from the first record pulled and cboCarName has all the records from that column. The only think I cannot figure out is how to change txtCarID and rtfCarDesc when I select a new value in cboCarName. I'm pretty sure I need to add the code to do it to the Sub cboCarName_SelectionChangeCommitted, but I cannot figure out what the code should be. Any help would be greatly appreciated. --MoonBear > ... nevermind, I finally figured this out. I now have to figure out how to> Any help would be greatly appreciated. > use the text typed into the combo box as part of the dataset.update because right now when save anew record, that is the only thing that doesn't save. Also you could use the DataTable.Select("column = value") method to get
the row selected in the combo box, then set the values of the other controls. Hope this helps some Izzy moonbear.green***@gmail.com wrote: Show quoteHide quote > I know I should have been able to find this in a book or in this or > another group, but I've been looking for hours and trying to get it to > work for hours, but my mind is just not getting around this thing. I'm > using VB.NET 2005 > > The setup is very simple. I have an Access db with one table (tblCar) > containing three fields (CarID, CarName, CarDesc). At formload, I > successfully pull all records for all fields and populate the form, > txtCarID, cboCarName and rtfCarDec all show the info from the first > record pulled and cboCarName has all the records from that column. The > only think I cannot figure out is how to change txtCarID and rtfCarDesc > when I select a new value in cboCarName. I'm pretty sure I need to add > the code to do it to the Sub cboCarName_SelectionChangeCommitted, but I > cannot figure out what the code should be. > > Any help would be greatly appreciated. > > --MoonBear Thanks for the reply, but the values for the other controls are stored
in the rows of the dataset. ANyways, I got that figured out, and got my other question figured out as well so now the app will display all the fields by row synced with the combo box and will save a new record, refresh the dataset and forward to the record just created. I've just got to do some more formatting code, like lists, and justification in the rtfCarDesc and it'll be good. Printing comes after that, but I'll not bore the NG with all that stuff. --MBGO Izzy wrote: Show quoteHide quote > Also you could use the DataTable.Select("column = value") method to get > the row selected in the combo box, then set the values of the other > controls. >
Passing data from one VB.Net application to another
Detect mouse movement from minimized application Build a Program Now! VB2005 Help with System.Timers.Timer in a module Is this the most efficient/fastest code to use? (beginner sql question) how to do this? "File is being used by another process" - error Form & Designer File Becoming Separated Issues with scope on a text box after .net conversion from vb6 creating a grid !! |
|||||||||||||||||||||||