Userform not activating

Shodi

Board Regular
Joined
May 24, 2016
Messages
51
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.
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
L

Legacy 456155

Guest
Are you showing frmUpdatePrices modally? It should take the focus if shown modally.
 
Solution

Shodi

Board Regular
Joined
May 24, 2016
Messages
51
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?
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,119
Office Version
  1. 2016
Platform
  1. Windows
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
 
L

Legacy 456155

Guest

ADVERTISEMENT

frmUpdatePrices is called by clicking command button in frmSelectItems
Set the "TakeFocusOnClick" property of this commandbutton to false.
 

Shodi

Board Regular
Joined
May 24, 2016
Messages
51
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
Thanks...
 

Watch MrExcel Video

Forum statistics

Threads
1,123,380
Messages
5,601,285
Members
414,440
Latest member
Kim0204

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
Top