Listbox Multiple column HELP

  • Thread starter Thread starter Brandon Johnson
  • Start date Start date
B

Brandon Johnson

I would like to add items to a listbox but i would like to use 3
columns in doing so. I was wondering if it was possible to use the
column property to add the items or something. Any suggestions please
let me know. thankyou much.
 
I would like to add items to a listbox but i would like to use 3
columns in doing so. I was wondering if it was possible to use the
column property to add the items or something. Any suggestions please
let me know. thankyou much.

No, you add columns to the List box in the List Box Record Source
property.
Then you need to set the Column count property to 3 as well as the
Column width property to show the new column.
If you would care to be a bit more specific, perhaps I or someone
else, can be more specific.
 
Basically i want to cycle through a tbl and if theres a record thats
checked(yes/no) then i want to throw the contents of the tbl into a
listbox. similar to the line in the loop where it throws only the
login_name in listbox but i want to throw the name, time, and date but
all in diff columns. I hope thats alittle clearer. if not let me know.
thanks for your help/time.


Set User = CurrentDb.OpenRecordset("tblLoginPWD", dbOpenDynaset)
UserCri = "[login_status] = 'yes'"
User.MoveFirst
Do Until User.EOF
If User!login_status = True Then
lstActivity.AddItem User!login_Name '&
User!login_time & User!login_date
End If
User.MoveNext
Loop
 
Assuming you've defined the list box as having 3 columns, try:

lstActivity.AddItem User!login_Name & ";" & _
User!login_time & ";" & User!login_date
 
Thanx for the input. however that did not work for me. any other
suggestions. thankyou

Assuming you've defined the list box as having 3 columns, try:

lstActivity.AddItem User!login_Name & ";" & _
User!login_time & ";" & User!login_date


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brandon Johnson said:
Basically i want to cycle through a tbl and if theres a record thats
checked(yes/no) then i want to throw the contents of the tbl into a
listbox. similar to the line in the loop where it throws only the
login_name in listbox but i want to throw the name, time, and date but
all in diff columns. I hope thats alittle clearer. if not let me know.
thanks for your help/time.


Set User = CurrentDb.OpenRecordset("tblLoginPWD", dbOpenDynaset)
UserCri = "[login_status] = 'yes'"
User.MoveFirst
Do Until User.EOF
If User!login_status = True Then
lstActivity.AddItem User!login_Name '&
User!login_time & User!login_date
End If
User.MoveNext
Loop
 
oh nevermind. this thing is acting wierd. anyway thanks much for your
help. much appreciated.
 
It works fine for me, which implies one (or more) of the following:

1) Your listbox isn't set up to accept 3 columns
2) Your usernames include semi-colons (or else you're using a really weird
format for date or time!)
3) Your regional settings have a different separator set than semi-colons
4) You didn't copy the code correctly

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Brandon Johnson said:
Thanx for the input. however that did not work for me. any other
suggestions. thankyou

Assuming you've defined the list box as having 3 columns, try:

lstActivity.AddItem User!login_Name & ";" & _
User!login_time & ";" & User!login_date


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brandon Johnson said:
Basically i want to cycle through a tbl and if theres a record thats
checked(yes/no) then i want to throw the contents of the tbl into a
listbox. similar to the line in the loop where it throws only the
login_name in listbox but i want to throw the name, time, and date but
all in diff columns. I hope thats alittle clearer. if not let me know.
thanks for your help/time.


Set User = CurrentDb.OpenRecordset("tblLoginPWD", dbOpenDynaset)
UserCri = "[login_status] = 'yes'"
User.MoveFirst
Do Until User.EOF
If User!login_status = True Then
lstActivity.AddItem User!login_Name '&
User!login_time & User!login_date
End If
User.MoveNext
Loop
 
Back
Top