traingamer / Greg has wisely suggested for you to use the ComboBox wizard.
To supplement this, there are several things to be aware of with Combo and List boxes.
Open the form in design mode and make sure the "Properties" window is open (from the menu, "View" -> "Properties")
Select your combo box and look at the "Data" tab in the Properties window.
ControlSource: If the field is "bound" to a table, this field will indicate the name of the field the value of the combo box is bound to. If there is no entry here, then the combo box control is considered "unbound".
RowSource: Often a SQL SELECT statement. Click on this field and then select the "..." command button that appears to the right to open the QueryBuilder. Here, the SQL statement can consist of one or more than "columns". The order of the "columns" is important.
If you used the Combo box wizard to create the combo box, you will probably have two columns -- the field name you selected PLUS the primary key field which will most likely be in the first column. This is an important point to consider when creating a combo box.
Close the QueryBuilder.
BoundColumn: Specifies the column in the SQL SELECT statement from the RowSource that is "bound" to the "ControlSource".
Now click on the "Format" tab.
ColumnCount: Number MUST match the number of columns in RowSource
ColumnWidths: specifies the widths for each column. Hide a column by using 0" width. For example,
0";1"
Will hide the first column and display the second column.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.