I have a form with a command button. When the button is clicked I want it to close the form; and then run the code below. The code below works fine; does just what I want it to. But I can't work out how/where to put the docmd.close code. Every where I've tried has either not run the rest of the code; closed the form I'm going to; or just plain crashed.
Code:
Private Sub Cmd08_Click()
On Error GoTo Err_Cmd08_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "StartForm02"
If IsNull(Me![Combo03]) Then
MsgBox "Please choose a report from the drop down list."
Else
stLinkCriteria = "[RptID]=" & Me![Combo03]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me![Combo03]
End If
Me.Combo03 = Null
Exit_Cmd08_Click:
Exit Sub
Err_Cmd08_Click:
MsgBox Err.Description
Resume Exit_Cmd08_Click