Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cancel routine (VB6)

    <P ID="edit" class=small>(Edited by D Willett on 20-Dec-03 12:17. cmnDialog1.CancelError = True
    )</P>Thanks, resolved it:
    cmnDialog1.CancelError = True


    My cancel routine doesn't work as it should.
    The PDF should show when cancel is pressed, I just get a white screen ?

    <pre>Private Sub cmdFindPDF_Click()
    'CancelError is True.
    On Error GoTo ErrHandler
    ' Set filters.
    cmnDialog1.Filter = "PDF Files (*.pdf)|*.pdf"
    ' Specify default filter.
    cmnDialog1.FilterIndex = 2
    ' Display the Open dialog box.
    cmnDialog1.ShowOpen
    Me.AcrobatPath = cmnDialog1.FileName
    Me.Pdf1.LoadFile Me.AcrobatPath
    Exit Sub
    ErrHandler:

    ' User pressed Cancel button.
    Me.AcrobatPath = "L:MMPDFESTpdfPDFViewer.pdf"
    Me.Pdf1.LoadFile Me.AcrobatPath
    End Sub</pre>


  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cancel routine (VB6)

    Try inserting the following as the first statement of the error handler.

    On Error GoTo -1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •