Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 simple select statement

Author  Topic 

mike009
Starting Member

15 Posts

Posted - 2006-05-11 : 23:32:25
hi

i have a simple query that will select from 2 tables
how can i display the result in list box

what i did is

[CODE]

Private Sub SearchB_Click()
Dim qry As String

qry ="Select Student.name , Student.address , Course.name , Course.proff
From Student , Course Where Student.id = Course.studentid"

mylistBox.RowSource = qry

End Sub
[/CODE]

but in the listbox i see only the firs column in the select statement
how can i display all columns
thx

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-05-12 : 09:29:12
The list box object allows you to specify the number of columns, and the widths of the columns. Make sure these values are properly set.

However, these only affect what appears when the drop-down is activated. For display, only one field can be shown. So if you want to display multiple fields you will have to create a concatenated field in your SQL statement.
Go to Top of Page
   

- Advertisement -