Userform not activating

Shodi

Board Regular
Joined
May 24, 2016
Messages
53
Hi everyone..

I have two Userforms named frmSelectItems and frmUpdatePrices

frmUpdatePrices is called by clicking command button in frmSelectItems

My issue is that frmUpdatePrices initializes when the cmd button is clicked but after it shows, the code then goes back to the cmd button sub (in the frmSelectItem module) to end the routine before frmUpdatePrices activates.

As per my understanding, and please correct me if I'm wrong, this should not happen as when the "frmUpdatePrices.Show" code is executed, the code should then complete running through the subroutines for frmUpdatePrices and then come back the frmSelectItems subroutine to continue with the code that comes after "frmUpdatePrices.Show".

Can anyone tell me why this is happening and how I can get around this.. the problem is that if a condition is met I want to add a few codes (to frmSelectItems after "frmUpdatePrices.Show") that will pull up other userforms after the frmUpdatePrices.Show code in succession (they too will need to be active as they come one after the other - once one form is updated and unloaded the next will be called.)

Hope I have not confused the issue.

Please let me know if I have... and which part I need to clarify.

Thanks everyone.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Are you showing frmUpdatePrices modally? It should take the focus if shown modally.
 
Upvote 0
Solution
Are you showing frmUpdatePrices modally? It should take the focus if shown modally.
No I had to set modal to False as the frmUpdatePrices has a reference form "frmShowSizes" that can be called and may need to be kept in view while "frmUpdatePrices" is updated. I can set modal to true but that would require the user to pull up the "frmShowSizes" for reference, then close it and again pull it up if in doubt. Is there a way around this?
 
Upvote 0
Have you tried Hiding the calling form before showing the callee.. something along these lines:

frmSelectItems.Hide
frmUpdatePrices.Show vbModeless

' rest of your code goes here ..

frmSelectItems.Show
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top