UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Add Combobox.selected Item To Listbox, Access 2016    
 
   
marinko888
post May 14 2019, 11:38 AM
Post#1



Posts: 32
Joined: 9-April 19



Hi,
I have an issue which I cannot resolve. I have to add ComboBox Selected Item to the 6th column of the first row in ListBox that is already populated with 5 columns. There is no SQL Query involved, just adding some string to the column.

Thanks for your help,
Go to the top of the page
 
theDBguy
post May 14 2019, 11:53 AM
Post#2


Access Wiki and Forums Moderator
Posts: 75,279
Joined: 19-June 07
From: SunnySandyEggo


Hi. Sounds like the Listbox is set as Value List. If so, you should be able to modify its RowSource to add the item you're talking about. Either that or use the .AddItem method of the Listbox.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
marinko888
post May 14 2019, 12:07 PM
Post#3



Posts: 32
Joined: 9-April 19



Hi,
I know how to Add Item but don't know how to Add Item on the specific coulumn, 6th position, in the row...
Go to the top of the page
 
theDBguy
post May 14 2019, 12:09 PM
Post#4


Access Wiki and Forums Moderator
Posts: 75,279
Joined: 19-June 07
From: SunnySandyEggo


Hi. Think of it this way. If the Row Source has the following entries: 1;2;3;4;5;1;2;3;4;5;1;2;3;4;5 then to add a sixth column, you simply change it to this: 1;2;3;4;5;6;1;2;3;4;5;6;1;2;3;4;5;6

Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
marinko888
post May 15 2019, 04:09 AM
Post#5



Posts: 32
Joined: 9-April 19



Hi,
I have found a solution for my problem. I cannot append anything to the first row of the LisBox control because it is Read Only so I have to Remove the entire row and Add new one instead. I am posting the solution for anyone facing the isue:

Dim intIndex As Integer

'remove original entry
ListBox1.RemoveItem intIndex

'place ComboBox Selected Item Value instead
ListBox1.AddItem ComboBox.Value, intIndex



I hope this will help somebody.
Have a good one!
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th May 2019 - 07:31 PM