need help with list box

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Hi all,

I'm trying to build a command button that grab the value
from a text box and display the result in the list box.
Somehow, the list box is showing only one column. I need
it to show more than one column.

The code is:

Dim db As DAO.Database
Dim rstuser As DAO.Recordset
Dim strstring As String

strstring = "SELECT UserName,UserInfo FROM User WHERE
UserName ='" & Me.TextSearch & "'"

Set db = CurrentDb()
Set rstuser = db.OpenRecordset("User")

With Me.Result

If rstuser.RecordCount > 0 Then
.RowSourceType = "Table/Query"
.RowSource = strstring
End If
End With

I also want to show the UserInfo too. Any suggestion??


Thanks,

mike
 
Back
Top