DoCmd.OpenFunction (Access)

Opens a user-defined function in a Microsoft SQL Server database for viewing in Microsoft Access.

Use the AllFunctions collection to retrieve information about the available user-defined functions in a SQL Server database.

OpenFunction (FunctionName, View, DataMode)


Dim objFunction As AccessObject 
Dim strFunction As String 
 
Set objFunction = Application.AllFunctions(0) 
 
DoCmd.OpenFunction FunctionName:=objFunction.Name, _ 
 View:=acViewDesign, Mode:=acReadOnly 

Arguments

The following argument is required

FunctionName (String) - The name of the function to open.

Optional arguments

The following arguments are optional

View (AcView) - An AcView constant that specifies the view in which to open the function. The default value is acViewNormal.


Possible values are

acViewDesign Design view
acViewLayout Layout view
acViewNormal Normal view
acViewPivotChart PivotChart view
acViewPivotTable PivotTable view
acViewPreview Print Preview
acViewReport Report view

DataMode (AcOpenDataMode) - An AcOpenDataMode constant that specifies the mode in which to open the function. The default value is acEdit.

Possible return values are acAdd - The user can add new records but can't view or edit existing records, acEdit - The user can view or edit existing records and add new records, acReadOnly - The user can only view records.