Results 1 to 9 of 9

Thread: VBA Form Load

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    61

    VBA Form Load

    Is there a function to load items when a form opens

  2. #2
    New Member
    Join Date
    Nov 2005
    Location
    NC, US
    Posts
    5

    Re: VBA Form Load

    Such as? Sure there is. What are you trying to do.

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: VBA Form Load

    VB Code:
    1. Private Sub Form_Activate()
    2.  
    3. End Sub

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VBA Form Load

    Moved to Office Development.

  5. #5
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: VBA Form Load

    In VBA you need to "_Initialize" event. Example below

    VB Code:
    1. Option Explicit
    2.  
    3. Dim Dreaming As Boolean
    4.  
    5. Private Sub UserForm_Initialize()
    6.     Me.txtName = "Dkenny"
    7.     Me.txtSalary = 1000000
    8.     If Me.txtSalary > 100 And Me.txtName = "DKenny" Then Dreaming = True
    9. End Sub
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  6. #6
    New Member
    Join Date
    Dec 2011
    Posts
    10

    Re: VBA Form Load

    You can use form_load event or activate to load items when the form opens e.g
    Private sub form_load()
    (your items will be identified by the specific command here)
    End sub

  7. #7
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: VBA Form Load

    i cannot beleive that a forum member since 05 has never seen

    form_load
    form_activate
    form..._whatever
    as they appear in the right hand box of the ide's editor
    when you select the form in the left box

    in all those years...

    what have you doing man?

    here to talk ( and be flippant it seems )

  8. #8
    New Member
    Join Date
    Jan 2012
    Posts
    4

    Re: VBA Form Load

    Delete this thread, it's a joke. Over 12,000 views only for all this garbage

  9. #9
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: VBA Form Load

    Quote Originally Posted by incidentals View Post
    i cannot beleive that a forum member since 05 has never seen
    Did you have a look at the posting time of the original thread?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

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