Results 1 to 5 of 5

Thread: Form Load event - cancel form load

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203
    Whilst in the form load - is there an easy way to cancel the form load? If i try to unload it I get an exception.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Try:
    Code:
    Exit Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    This doesn't work

    If you exit the sub the form still loads I want to cancel the form load.

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    you can't, you lhave to prevent it from loading.
    Option Explicit
    Dim x, y

    Private Sub Form_Load()
    Dim x
    x = y
    If x = y Then
    Unload Me
    Else
    MsgBox "MI"
    'bla abl
    End If

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Guest
    Wouldn't it just be:

    Code:
    Private Sub Form_Load()
    'If cancelled then...
    Unload Me
    Set Form1 = Nothing
    End
    'End If
    End Sub

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