Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If mblnParsingRecords Then ' we're parsing mblnAbortImport = True Cancel = 1 End If End SubI set mblnAbortImport to true, then when the program goes to import the next line of the text file, the first thing I check is the value of mblnAbortImport.
If mblnAbortImport Then If MsgBox("Are you sure you want to cancel the import?", vbYesNo) = vbYes Then Me.progressTotal.Visible = False Me.lblInfo.Visible = True Call gsubDelay(500) If DeleteImportedifCancelled(mlngReportControlID) Then MsgBox "Transaction Import Successfully Cancelled ..." mblnParsingRecords = False Unload Me Else MsgBox "Didn't clean-up properly for some reason - check it out !" End If Exit Sub End If End IfThen when the query unload event gets called with the 'Unload Me' - it does call Form Unload - but the form does not unload.