Larry W Jordan Jr.
Derik Harris
Microsoft Corporation
Created: July 15, 1996
Revised: August 7, 1996
Larry W Jordan Jr. is a Senior Microsoft Access support engineer. His main focus is VBA, wizard and add-in development and Visual SourceSafe integration.
Derik Harris is a Senior Microsoft Access content engineer. His primary responsibility is writing, editing, and publishing Microsoft Access related material for the Microsoft Knowledge Base and the Microsoft Web site.
Click to open or copy the FUNCWIZ project files.
The Function Template Wizard provides a simple tool to create skeleton routines for use in Visual Basic for Applications. The premise of the wizard assumes that every routine that you create in Visual Basic for Applications has some basic, intrinsic elements that include error trapping and/or data access object (DAO) access code. The wizard can create the following sample syntax with a button click:
Public Function TestFunction1() As Variant
Dim Msg As String ' for error handling
On Local Error GoTo TestFunction1_Err
TestFunction1 = True
TestFunction1_End:
Exit Function
TestFunction1_Err:
Msg = "Error #: " & Format$(Err.Number) & vbCrLf
Msg = Msg & Err.Description
MsgBox Msg
Resume TestFunction1_End
End Function
The Function Template Wizard provides a simple tool to create skeleton routines for use in Visual Basic for Applications. The premise of the wizard assumes that every routine that you create in Visual Basic for Applications, has some basic intrinsic elements that include error trapping and/or DAO access code.