need help with list box

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top