Thanks Marco for the hint. I am not sure if i followed your hints correctly because when I enable the timer it then never goes into the timer function. I did use a range of time from half second to 5 sec.
I am not a
VB programmer so i may be doing something worng. I am pasting here my code. thnanks and cheers:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
' Form_Unload (1)
Call TerminateExtraObject(ExtraEvents1, Frame1)
Timer1.Enabled = True
If flag = True Then
ExtraEvents1 = Nothing
End If
End Sub
Private Sub MkSessExtra_Click()
Call InitExtraObject(ExtraEvents1, Frame1)
End Sub
Private Sub Form_Load()
FileSessione3270 = App.Path & "\3270.edp"
ShortNameSessione3270 = "A"
flag = True
End Sub
Private Sub SganciaSess_Click()
Call TerminateExtraObject(ExtraEvents1, Frame1)
End Sub
Private Sub Timer1_Timer()
Unload Me
flag = True
End Sub