Full Version: Adding To Listbox From Combo Box & Text Box
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
christo1984
i am creating a list box that gets data added from a text box and also a combo box.
The list box has 4 columns, 1 for the singer, 1 for song, 1 for track number and 1 for cd id.
I am able to add the details for the song in each column however i can only get 1 column from the combo box (where the song name, cd id and track number come from) into the list. How can i set it up so that it brings the data for the item selected in the combo box across correctly.

I have a command button that after text is entered and the item from the combo box is selected the following code is used:


CODE
Private Sub Command28_Click()

PlaylistRotation.AddItem Singer & ";" & song & ";" & song & ";" & song

End Sub
Larry Larsen
Hi
welcome2UA.gif

May be if you make reference to the actual column of the combo..:
eg:

CODE
Private Sub Command28_Click()

strSong = Me.ComboName.Column(1)
strCdID =  Me.ComboName.Column(2)
strTrack =  Me.ComboName.Column(3)

PlaylistRotation.AddItem Singer & ";" & strSong & ";" & strCdID & ";" & strTrack

End Sub


Im making reference to columns 1,2,3 you may have different values...

Note column references start at (0)..

HTH's
thumbup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.