Table of contents
TOC
Collapse the table of content
Expand the table of content

ObjectFrame.RowSourceType Property (Access)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

You can use the RowSourceType property (along with the RowSource property) to tell Microsoft Access how to provide data tothe specified object. Read/write String.

Syntax

expression. RowSourceType

expression A variable that represents an ObjectFrame object.

Remarks

The RowSourceType property uses the following settings.

SettingDescription
Table/Query(Default) The data is from a table, query, or SQL statement specified by the RowSource setting.
Value ListThe data is a list of items specified by the RowSource setting.
Field ListThe data is a list of field names from a table, query, or SQL statement specified by the RowSource setting.

Note You can also set the RowSourceType property with a user-defined function. The function name is entered without a preceding equal sign (=) and without the trailing pair of parentheses. You must providespecific function code argumentsto tell Microsoft Access how to fill the control.

In Visual Basic, set the RowSourceType property by using a string expression with one of these values: "Table/Query", "Value List", or "Field List". You also use a string expression to set the value of the RowSource property. To set the RowSourceType property to a user-defined function, enter the name of the function.

When you have a limited number of values that don't change, you can set the RowSourceType property to Value List and then enter the values that make up the list in the RowSource property.

When you create a user-defined function to insert items into a list box or combo box, Microsoft Access calls the function repeatedly to get the information it needs. User-defined RowSourceType functions must be written in a very specificfunction format.

Example

The following example sets the RowSourceType property for a combo box to Table/Query, and it sets the RowSource property to a query named EmployeeList.

Forms!Employees!cmboNames.RowSourceType = "Table/Query" 
Forms!Employees!cmboNames.RowSource = "EmployeeList"

See also

Concepts

ObjectFrame Object

© 2018 Microsoft