Private Sub Add_Vehicle_Details_Command_Button_Click()
'What to do if an error occurs, that is, error trapping
On Error GoTo Err_Add_Vehicle_Details_Command_Button_Click
'Variable to hold the name of the form
Dim stDocName As String
'Variable to hold any criteria needed, not used
Dim stLinkCriteria As String
'Put the name of the form in the variable
stDocName = "Vehicle Specification Form"
'Open the form
DoCmd.OpenForm stDocName, , , stLinkCriteria
'This is the name of the sub, so you do not need to
'use it again.
'Private Sub Add_Vehicle_Details_Command_Button_Click()
'You already have instuctions for error trapping,
'so you do not need more.
'On Error GoTo Err_Add_Vehicle_Details_Command_Button_Click
'The action to perform, you need this. You should
'add a little to it.
DoCmd.Close [blue]acForm, Me.name[/blue]
'What to do if an error does not happen, that is,
'end of story.
Exit_Add_Vehicle_Details_Command_Button_Click:
Exit Sub
'What to do if an error happens, part 2
Err_Add_Vehicle_Details_Command_Button_Click:
MsgBox Err.Description
Resume Exit_Add_Vehicle_Details_Command_Button_Click
'You already have one of these
'Exit_Add_Vehicle_Details_Command_Button_:
' Exit Sub
End Sub