Avatar billede kroning Nybegynder
14. april 2016 - 17:03 Der er 6 kommentarer og
1 løsning

SubItems i en Combobox

Jeg har en combobox hvor rækkekildetype er sat til værdiliste

Jeg tilføjer Items ved at bruge AddItem, men hvordan tilføjer jeg SubItems?

Bruger Access 2013
Avatar billede terry Ekspert
14. april 2016 - 17:42 #1
I would suggest one combo for main item and another combo for sub items. Contents of sub items changes depending on selection from main item combo
Avatar billede kroning Nybegynder
14. april 2016 - 23:46 #2
I think you misunderstand me. My combobox is set to the valuelist and is therefore unbound. Subitems have nothing with another table to do.
Avatar billede terry Ekspert
15. april 2016 - 08:49 #3
Try giving an example of your data (valuelist).
Avatar billede kroning Nybegynder
15. april 2016 - 09:45 #4
We can call them firstname and lastname

So the combobox should show:

John  | Petersen
Henry | Nilson
Poul  | Andersen
Avatar billede terry Ekspert
15. april 2016 - 10:12 #5
Not sure that helps.
In your example, what is the main category and what is the sub category?


http://sqllessons.com/categories.html


Anyway, if your populating the combo yourself using a value list then you can put whatever you want in it.

John
- Petersen
- Smith
Peter
- Pan
Avatar billede kroning Nybegynder
15. april 2016 - 18:38 #6
Well, it was as I thought, very simple :-)

Found this text on https://msdn.microsoft.com/en-us/library/office/ff835377.aspx as I apparently had forgot to read.

For multiple-column lists, use semicolons to delimit the strings for each column (for example, "1010;red;large" for a three-column list)

So problem solved.
Avatar billede terry Ekspert
16. april 2016 - 09:41 #7
ah, so sub items you mean columns :-)

Good you found a solution and thanks for the poinbts
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester