Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form not unloading
Message
 
À
01/07/2002 14:25:21
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00674032
Message ID:
00674044
Vues:
20
>There something unclear - how and why you unload form with code in QueryUnload event? Can you post the code?

Here is the code in the query unload event that determines if the user is currently importing/parsing records. I want to do some clean-up if they cancel half-way through...
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If mblnParsingRecords Then ' we're parsing
        mblnAbortImport = True
        Cancel = 1
    End If
End Sub
I 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 If
Then when the query unload event gets called with the 'Unload Me' - it does call Form Unload - but the form does not unload.
Al Williams

Anola MB, CANADA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform