populate a combo box in a form

J

John MilburySteen

Hi Access Gurus,
I have a form in Access 2000 which helps our department schedule classes.
The form has a combo box which I want to populate with a list of classes
from which to choose. That would be simple, but I want the combo box's pull
down menu to appear with three columns:

ClassName, CountOfRegistrationID (how many students enrolled so far in the
class) and ClassID,

with the third column bound. (ClassID is a meaningless number from the
user's point of view.)


In the row source I specify:

SELECT ClassName, CountOfRegistrationID, ClassID FROM ClassQuery;

ClassQuery is a group query.

This doesn't work. However the following SQL statements work (col. 2
bound):

SELECT ClassName, ClassID FROM ClassQuery;
SELECT CountOfRegistrationID, ClassID FROM ClassQuery;

Are combo boxes limited to two columns?
 
G

Guest

Combo boxes are not limited to 2 columns. Within the combo box properties,
there is a property that allows you to define the number of columns. Just
enter a 3 in this property. Additionally, there's a property that allows
you to define the column widths. Just put a comma in between each column
width. For instance for the three columns you describe, you may want to put
..5", .5", 0". That will hide that last column but make it available, as well
as allow it to be the bound column. There's also a property that allows you
to define the width of all of the columns together. Make sure that this
width is big enough to contain the total width of all of the individual
columns combined.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top