Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Load vs Form Open (Access 2003)

    OK, somebody had to ask this and my mental skin is thick. I thought I'd seen it before, but probably just in my own mind.

    What is the difference and/or what happens differently between

    Form Open

    and

    Form Load

    There, I did it.
    Cheers,
    Andy

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Re: Form Load vs Form Open (Access 2003)

    The two major differences are:

    1) The On Open event has a Cancel argument. If you set it to True, opening the form is canceled. For example:

    Private Sub Form_Open(Cancel As Integer)
    If CurrentUser = "HansV" Then
    Cancel = True
    End If
    End Sub

    The On Load event doesn't have a Cancel argument. So if you need to cancel opening the form depending on some condition, use the On Open event.

    2) The On Open event occurs before the first record is loaded. The On Load event occurs when the records are loaded. So if you need to perform some action depending on the data in the first record, use the On Load event.

    (And since you ask <img src=/S/grin.gif border=0 alt=grin width=15 height=15>, the corresponding events for closing a form are On Close and On Unload. Here, On Unload is the one that occurs first and that has a Cancel argument)

  4. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Load vs Form Open (Access 2003)

    Hans,

    Ya beat me to it! The On Close, etc. actions came to my mind after I Posted, but I figured if I read your answer for On Load in front of a mirror, then I'd have the correct answer. Sounds logical, doesn't it?

    Thanks again,
    Cheers,
    Andy

Posting Permissions

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