+ Reply to Thread
Results 1 to 4 of 4

Calling and prefilling a form from another form

  1. #1
    Forum Contributor
    Join Date
    03-19-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Office 2013, Office 365 Pro Plus
    Posts
    182

    Calling and prefilling a form from another form

    Hi, I have two forms, one that does pressure analysis on some data and one that applies temperature analysis.

    If the user selects a checkbox from the pressure form then they are asked if they would also like to perform temperature analysis. If so the temperature form is loaded, so far so good!

    There are common fields in both forms and I would like to prefill the temperature from with the values from the pressure form. I have some partial success here, this is what currently happens
    1) fill in pressure form and click "OK"
    2) pressure form is hidden -> so fields are still filled next time I run macro
    3) I'm asked whether I would also like to run temperature analysis
    4) I say yes and temperature form opens, ALL FIELDS ARE EMPTY!
    5) I close temperature form
    6) I run pressure form again and again state I also want to run temperature analysis
    7) Temperature form opens, THIS TIME FIELDS ARE FILLED CORRECTLY

    Can anyone please explain why I can get the filed to fill on the second itteration, but not the first?

    An extract from my pressure from is

    Please Login or Register  to view this content.
    Last edited by jlt199; 04-05-2012 at 04:17 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Calling and prefilling a form from another form

    Hello jlt199,

    You had your Load and Show in the wrong order. When a UserForm is loaded, the window and all the controls are created. The controls' values can be set at this time to display when the UserForm is shown. Move the Show after the With and it work correctly.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    03-19-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Office 2013, Office 365 Pro Plus
    Posts
    182

    Re: Calling and prefilling a form from another form

    So easy when you know how :D

    Many thanks

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Calling and prefilling a form from another form

    Hello jlt199,

    You're welcome. The Devil is in the details!

+ 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