• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

List Box in MS Access

Hi Expert,

I have a list box in a form and it should show DeptName, I have RowSoure for this listbox is Select DeptNo, DeptName, DeptDescription from Dept.

The data are here

1  CS    Computer Science
2  HR    Human Resource

I want the list box text show DeptName and value use DeptNo, How I can do it?

Thanks in Advance.
0
dshi15
Asked:
dshi15
  • 6
  • 6
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Set as following:

Column Count  2
Bound Column 1
Column Widths   0;2

mx
0
 
dshi15Author Commented:
I'm going to do it. Could you explain why?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
sure ... but let me know if it works first :-)

mx
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dshi15Author Commented:
It works, why?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
With a list box (or combo box) you can display multiple columns.  You set the number of columns to display using the Column Count property.

If you want to 'hide' a column, you do that in the Column Widths property ... by using a zero (0) for that column position.

mx
0
 
dshi15Author Commented:
I changed Bound Column 2, it show me same text on listbox.
0
 
dshi15Author Commented:
>>With a list box (or combo box) you can display multiple columns.  You set the number of columns to display using the Column Count property.

"Column Count  2 "means two columns display or three columns?


0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
The Bound column will not affect the display.  It determine what data from your Row Source is stored in a table driving your form ... IF ... you list box has a Control Source that is a field in the table (or query) driving your form.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"Column Count  2 "means two columns display or three columns?

Two.  But again, you can hide any column by setting the Column Width for that column to zero.

mx
0
 
dshi15Author Commented:
Thank you very much, but I still not get this
>>The Bound column will not affect the display.  It determine what data from your Row Source is stored in a table driving your form ... IF ... you list box has a Control Source that is a field in the table (or query) driving your form.

and if I want hide column, I need set Column Widths  1;0

Is that right?

I need go, I will back an hour later.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Please close the question an assign points ... and I will explain more later.

mx
0
 
dshi15Author Commented:
Thanks, if you have time, please explain little bit more.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now