RowSourceType, RowSource Properties Example — Settings
The following examples show sample RowSource property settings for each RowSourceType property setting.
When the RowSourceType Property Is Set to Value List
If the RowSourceType property is set to Value List, the following table shows valid settings for the RowSource and ColumnCount properties and an illustration of the resulting list.
RowSource setting | List |
---|---|
Mon;Tue;Wed
(ColumnCount = 1) |
One-column list with three rows |
1;Monday;2;Tuesday;3;Wednesday;4;Thursday
(ColumnCount = 2) |
Two-column list with four rows |
Country;Capital;China;Beijing;Brazil;Brasilia
(ColumnCount = 2, ColumnHeads = Yes) |
Two-column list with one row of column heads and two rows of data |
When the RowSourceType Property Is Set to Table/Query
If the RowSourceType property is set to Table/Query, you can set the RowSource property to a table or query name — for example, CategoryList.
The following is a valid SQL statement for a two-column list drawn from the Categories table:
SELECT CategoryID, CategoryName FROM Categories _
ORDER BY CategoryName;
If the CategoryList query and the SQL statement define the same set of records, the list for either property setting looks like the following illustration.
When the RowSourceType Property Is Set to Field List
If the RowSourceType property is set to Field List and the RowSource property to CategoryList (the query described in the previous example), the resulting list looks like the following illustration.
When the RowSourceType Property Is Set to a User-Defined Function
If the RowSourceType property is set to the name of a user-defined function, then the RowSource property setting can be left blank. For example, a user-defined function named ListMDBs that fills a combo box with the names of all the databases in the current directory is entered in the property sheet as in the following illustration.