Code Examples For RunCommand Constants

Create a New AutoForm

acCmdNewObjectAutoForm

The following code will create a new form based on the table passed to it. This is the same as using the Autoform button.

'***************** Code Start *******************
' This code was originally written by Terry Wickenden.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.

Sub NewForm(strTable As String)
    DoCmd.SelectObject acTable, strTable, True
    DoCmd.RunCommand acCmdNewObjectAutoForm
End Sub

'****************** Code End ********************