Results 1 to 4 of 4

Thread: Cancel statment - C. Dialog

  1. #1
    Stiletto
    Guest

    Cancel statment - C. Dialog

    When i open a Common Dialog control and then click Cancel it will gimma an error.
    I just forgot the Cancel statment so if the user clicks cancel it will abort..
    tnx

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Cancel statment - C. Dialog

    Originally posted by Stiletto
    When i open a Common Dialog control and then click Cancel it will gimma an error.
    I just forgot the Cancel statment so if the user clicks cancel it will abort..
    tnx
    If the CancelError is set to True, it will cause an error when Cancel is clicked(duh). There is no abort, you just trap the error.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You need to change the CancelError property to true for the common dialog, then use error handing. I think the error code for the cancel button is 32755. So put some EH code like this:
    VB Code:
    1. On Error GoTo ErrLine
    2. CD1.ShowOpen
    3. 'do your CD code here
    4. Exit sub
    5. ErrLine:
    6. if Err.Number <> 32755 then
    7.      msgbox "Error!  " & err.description
    8. end if
    <removed by admin>

  4. #4
    Stiletto
    Guest
    Yup.
    This works even if CancelError=False

Posting Permissions

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



Click Here to Expand Forum to Full Width