Hi guys,
I have a comboBox which is populated by records from the database. The code that I use to do this is
Code:
Set cnAddMovie = New ADODB.Connection
cnAddMovie.Provider = "Microsoft.Jet.OLEDB.4.0"
cnAddMovie.Open App.Path & "./tek.mdb"
Set rsMovie = New ADODB.Recordset
'Add another ComboBox
Dim strSQL As String
strSQL = "SELECT UserNo, FirstName, LastName FROM users"
rsMovie.Open strSQL, cnAddMovie, adOpenForwardOnly, adLockReadOnly, adCmdText
With cboNames
.Clear
Do While Not rsMovie.EOF
.AddItem rsMovie.Fields("FirstName").Value
.ItemData(.NewIndex) = rsMovie.Fields("UserNo").Value
rsMovie.MoveNext
Loop
End With
rsMovie.Close
Set rsMovie = Nothing
End Sub
This ends up displaying the first name in the combobox. How can I include the last name field to appear on the same line with FirstName?
Thanks