Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

List Box in MS Access

Posted on 2009-12-31
12
Medium Priority
?
242 Views
Last Modified: 2013-11-28
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
Comment
Question by:dshi15
  • 6
  • 6
12 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 26155850
Set as following:

Column Count  2
Bound Column 1
Column Widths   0;2

mx
0
 
LVL 1

Author Comment

by:dshi15
ID: 26155874
I'm going to do it. Could you explain why?
0
 
LVL 75
ID: 26155895
sure ... but let me know if it works first :-)

mx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dshi15
ID: 26155964
It works, why?
0
 
LVL 75
ID: 26155977
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
 
LVL 1

Author Comment

by:dshi15
ID: 26155979
I changed Bound Column 2, it show me same text on listbox.
0
 
LVL 1

Author Comment

by:dshi15
ID: 26156001
>>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
 
LVL 75
ID: 26156008
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
 
LVL 75
ID: 26156022
"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
 
LVL 1

Author Comment

by:dshi15
ID: 26156033
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
 
LVL 75
ID: 26156042
Please close the question an assign points ... and I will explain more later.

mx
0
 
LVL 1

Author Closing Comment

by:dshi15
ID: 31671674
Thanks, if you have time, please explain little bit more.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question