I have one continuous form with a search feature. When a hyperlink field is clicked, a second form with a sublist opens. There is a button "cmdReset" to close the second form, that has been working correctly.
I added a button to preview a report and want the cmdReset button to close both the form and the report. For some reason it has to be clicked twice to work. I've tried different things including changing the order of the 2 objects closing.
TIA for any help.
Code:
Private Sub cmdReset_Click()
'GROUP FORM
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control
'Clear all the controls in the Form Header section.
For Each ctl In Forms![AKAListForm].Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next
'Remove the form's filter.
Forms![AKAListForm].FilterOn = False
DoCmd.Close acReport, "AKAGroupRpt"
DoCmd.Close acForm, "AKAGroupForm"
End Sub