Hi,
I have created a form but when the user clicks the x button I want it just to unload and not save anything. I have included this code in the VBA module but if I click close and some of the combo boxes are empty it still comes up with an error.
Code:Private Sub close_form_Click() On Error Resume Next Dim ctl As Control For Each ctl In Me.Controls If ctl.ControlType = acTextBox Then ctl = Null Next Set ctl = Nothing DoCmd.Close End Sub