P
P. Prosper
Hello,
Could someone give me a hint why my CancelPrint Logic won't work despite the
DoEvents ?
in form lvele declaration I have
Public Shared CancelPrint As Boolean
'Printing Logic
Do While rsAccount.EOF = False And CancelPrint = False
Application.DoEvents()
SelFormula = "{Socios.NumSocio} in " & Chr(34) &
rsAccount.Fields("NumSocio").Value & Chr(34) & " to " & Chr(34) &
rsAccount.Fields("NumSocio").Value & Chr(34)
Dim crptStatement As New crptStatements_ATH
If ChkNotificacion.CheckState = CheckState.Unchecked Then
crptStatement.Section7.SectionFormat.EnableSuppress = True
Else
crptStatement.Section7.SectionFormat.EnableSuppress = False
End If
crptStatement.RecordSelectionFormula = SelFormula
i = i + 1
ProgressBar1.Value = i
crptStatement.PrintToPrinter(1, False, 0, 0)
rsAccount.MoveNext()
Loop
If CancelPrint Then
MsgBox("Printing Canceled By User", MsgBoxStyle.Exclamation)
End If
Private Sub CmdCancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
'This togles the CancelPrint flag
CmdCancel.Click
CancelPrint = True
End Sub
Could someone give me a hint why my CancelPrint Logic won't work despite the
DoEvents ?
in form lvele declaration I have
Public Shared CancelPrint As Boolean
'Printing Logic
Do While rsAccount.EOF = False And CancelPrint = False
Application.DoEvents()
SelFormula = "{Socios.NumSocio} in " & Chr(34) &
rsAccount.Fields("NumSocio").Value & Chr(34) & " to " & Chr(34) &
rsAccount.Fields("NumSocio").Value & Chr(34)
Dim crptStatement As New crptStatements_ATH
If ChkNotificacion.CheckState = CheckState.Unchecked Then
crptStatement.Section7.SectionFormat.EnableSuppress = True
Else
crptStatement.Section7.SectionFormat.EnableSuppress = False
End If
crptStatement.RecordSelectionFormula = SelFormula
i = i + 1
ProgressBar1.Value = i
crptStatement.PrintToPrinter(1, False, 0, 0)
rsAccount.MoveNext()
Loop
If CancelPrint Then
MsgBox("Printing Canceled By User", MsgBoxStyle.Exclamation)
End If
Private Sub CmdCancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
'This togles the CancelPrint flag
CmdCancel.Click
CancelPrint = True
End Sub