Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About listbox

Status
Not open for further replies.

jack1080

Programmer
Jun 2, 2007
34
0
0
MY
1)How to set show or not show key column for list box in propeties windows?
2)For list box, after doing
lstListBox.rowsource="select field1, field2 from tbl"
lstListBox.requery
How to
a)Set show keycolumn;
b)make the first item in the listbox selected?A
 
jack1080,
a) Show/Hide the key (or any) column using the Column Widths propety of the control.

b) [tt]Me.ListBox.Selected(0) = True[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
To expound on Column Widths... you specify any columns you do not want to display as having a width of 0.
 
Thanks, may I know if I do a listbox.value, is it always return the selected data of the first field in the query?
 
The value will be the bound column. This will not be true if your listbox is multi-select.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top