Easy: Load sub in another form - but the new form isn't visible!

Probably quite easy, but I'm a newbie and can't get it to work...

When I call a sub in another form, like this:
     ' This is frmMain, now call
     ' a sub in frmNewFormName:
     Call frmNewFormName.subRunMe

the subRunMe-sub runs fine, but I want that frmNewFormName should be visible when running the sub... I've tried several snippets o' code to make that happen, like adding "Me.Show vbModal" in the begining of subRunMe, but then I have to close the form before the rest of the sub continues =(

Any tips?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What about using this one?


try this ..

Load frmNewFormName
Call frmNewFormName.subRunMe

cosmo3dAuthor Commented:
None of them did work :( I've tried several other "Refresh"-codes, like Me.Refresh and DoEvents, but with no success.

The solution was to show frmNewFormName from the first form with a normal frmNewFormName.Show syntax, and then use a timer on frmNewFormName with Interval:20, to call the subRunMe If Me.Visible... Kind of cumberstone - but at least it works!

If any of you have a better solution, add proposed answer. Thanks!
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

in the sub, couldn't you just put "FrmNewFormName.Visile = True"
and set it to false again when the sub ends?
cosmo3dAuthor Commented:
Nope. "frmNewFormName.Visible = True" won't work, as I need to display the form modally. Then, I believe "frmNewFormName.Show" is the same as "frmNewFormName.Visible" = True", so I added "frmNewFormName.Show vbModal" to the sub, but that didn't work (I've tried it before too).

What happened then was that the form had to be closed before the sub continued...
That's right. You have to close the modal form to continue. Why don't you use

Call frmNewFormName.subRunMe

and then say

frmNewFormName.Show vbModal

This 1st calls the procedure and then shows and it continues. Hope this helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.