I am loading a form when a button is clicked. After that form finishes an upload (or if a cancel button is clicked) it is unloaded. When the form unloads it executes the same line which loaded it in the first place "Load FrmUpload" and I receive an error "run time error 364 - Object was unloaded". Why is it executing the same line twice. I have tried loading and unloading the form in different ways using flags and everything I can think of and it always goes back to the line it left off at, I'm out of ideas. Can someone please help?
Private Sub CmdUpload_Click()
Load FrmUpload
End Sub
Private Sub Form_Load()
Me.Show
DoEvents
'some other code
Unload Me
End Sub
Private Sub CmdUpload_Click()
Load FrmUpload
End Sub
Private Sub Form_Load()
Me.Show
DoEvents
'some other code
Unload Me
End Sub