+ Reply to Thread
Results 1 to 7 of 7

Calling a user form initialize sub when entering the form to populate combobox...

  1. #1
    Registered User
    Join Date
    07-28-2012
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    31

    Calling a user form initialize sub when entering the form to populate combobox...

    I am using a command button on my spreadsheet to call a user form. In the form I need to populate the combobox. I have an "Initialize form sub" to do this which works within the form using a "Clear" button which writes "" to each textbox, and gets the combobox populated, and I don't know how to get it to go when the form is launched. If the user is already in the form and clicks the clear button, it works fine. But entering the form, the combobox is empty... I tried to call the initialize right after the showform but no go...

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Calling a user form initialize sub when entering the form to populate combobox...

    @regupnorth

    Can you upload your workbook?

  3. #3
    Registered User
    Join Date
    07-28-2012
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Calling a user form initialize sub when entering the form to populate combobox...

    Here it is.
    Click on Add Asset to Shipping List button in spreadsheet and it loads the data entry form... Combobox is not populated. Click "Clear" button in form, which call initialze routine, any existing data in textboxes in form are cleared and the combobox populated...
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Calling a user form initialize sub when entering the form to populate combobox...

    @regupnorth

    add this to your Asset_UserForm module.

    Please Login or Register  to view this content.
    remove from Command_Button_Assets_Entry_Form_Click

    Please Login or Register  to view this content.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Calling a user form initialize sub when entering the form to populate combobox...


  6. #6
    Registered User
    Join Date
    07-28-2012
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Calling a user form initialize sub when entering the form to populate combobox...

    Thank you for that. I then took that over to another project but I messed it up somewhere. Can you point it out? In the attached file I select the "Enter Assets" button but it doesn't initalize... Frustrating since I thought, since this is basically a smaller version of the original program, it would work... but thats my problem... assuming.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Calling a user form initialize sub when entering the form to populate combobox...

    Here this will work for you. the problem was you were not actually using the UserForm_Initialize. So your comboboxes would not populate.

    Field Asset Inventory Test Template Uploadver.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1