Databound combobox in VB6
Posted in 2001
Topics: Stored Procedures & SPL
> Hi, > > I have a databound combobox on my form together with some textboxes. The > databound combobox is linked to a table. The combobox displays names. I want > the textboxes to display the data from the table according to the selected > name in the combobox. The only problem is that I don't know how to do it. > Can someone help me. > > Thanks, > Boeman > > Sylvain Girard > E-mail Address(es): > s5034447@khk.be > sylvainx_girardx@hotmail.com
I think what you mean is that you are storing the id code and you want to display the name. To do that, in the property list of the combobox, create a query for the rowsource (click the ellipse [...] button). Place the ID field first, then the name field (sort it if you like, it makes sense to do so). Then close the query and click yes, you want to save the changes. Now you need to set the number of columns and column widths on the property list. The number of columns will be 2. If you want to display the name instead of the ID, the column widths will look something like this: 0";2" The last thing to set is the list width to 2" (or however wide you made the column widths). Access will automatically set the Limit To List property to Yes which is how it must be for this method to work. Boeman <s5034447@khk.be> wrote in message news:94id90$ov7$1@newspc4.rz.uni-hohenheim.de... > > Hi, > > > > I have a databound combobox on my form together with some textboxes. The > > databound combobox is linked to a table. The combobox displays names. I > want > > the textboxes to display the data from the table according to the selected > > name in the combobox. The only problem is that I don't know how to do it. > > Can someone help me. > > > > Thanks, > > Boeman > > > > Sylvain Girard > > E-mail Address(es): > > s5034447@khk.be > > sylvainx_girardx@hotmail.com > > >
No, I want to select a name in the combobox. Then the textboxes should display the adres and so on from the name in the combobox. Database programming is fairly new to me so... "Karen" <kstern@alittlehelp.net> schreef in bericht news:qI3b6.3003$ju6.512909@typhoon.nyroc.rr.com... > I think what you mean is that you are storing the id code and you want to > display the name. To do that, in the property list of the combobox, create > a query for the rowsource (click the ellipse [...] button). Place the ID > field first, then the name field (sort it if you like, it makes sense to do > so). Then close the query and click yes, you want to save the changes. Now > you need to set the number of columns and column widths on the property > list. The number of columns will be 2. If you want to display the name > instead of the ID, the column widths will look something like this: 0";2" > The last thing to set is the list width to 2" (or however wide you made the > column widths). Access will automatically set the Limit To List property to > Yes which is how it must be for this method to work.
Boeman wrote: > Database programming is fairly new to me so... Hm, what about posting to newsgroups? R. -- Erratic news-swerver! :. post+e-mail to be sure I get your msg. aacdehirrsty The Open University is not responsible for content herein, which may be incorrect and is used at reader's own risk.