Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying one userform from another


Ok, this is such a rediculously simple problem, I am almost to
embarrassed to ask. After searching high and low, I cannot for the lif
of me figure out how to display one userform, when a user clicks on
button in another?

A simple Userform2.show does not work- the code breaks with an "objec
required" error.

I know I'm going to kick myself when I see the answer ... (can yo
delete topics you stated yourself so i can hang my head in shame?

--
CF

-----------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...fo&userid=2730
View this thread: http://www.excelforum.com/showthread.php?threadid=47365

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Displaying one userform from another

Hi CFD,

I could not reproduce your error and

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub

worked for me.


---
Regards,
Norman



"CFD" wrote in message
...

Ok, this is such a rediculously simple problem, I am almost too
embarrassed to ask. After searching high and low, I cannot for the life
of me figure out how to display one userform, when a user clicks on a
button in another?

A simple Userform2.show does not work- the code breaks with an "object
required" error.

I know I'm going to kick myself when I see the answer ... (can you
delete topics you stated yourself so i can hang my head in shame?)


--
CFD


------------------------------------------------------------------------
CFD's Profile:
http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=473653



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying one userform from another


Hmmm was your command button on a different userform, or on
worksheet?

I can get it to open using a button on a worksheet, but not a button o
a different user form

--
CF

-----------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...fo&userid=2730
View this thread: http://www.excelforum.com/showthread.php?threadid=47365

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Displaying one userform from another

Perhaps you are not putting your code in the correct location:

1. Open your VB editor
2. Select Userform1
3. Dbl click on the command button to view the code for this button
4. Paste Norman Jones code in this module. It's not a normal module,
but rather a special kind of module that contains the code for the userform1
and associated controls, like buttons.

HTH

"CFD" wrote:


Ok, this is such a rediculously simple problem, I am almost too
embarrassed to ask. After searching high and low, I cannot for the life
of me figure out how to display one userform, when a user clicks on a
button in another?

A simple Userform2.show does not work- the code breaks with an "object
required" error.

I know I'm going to kick myself when I see the answer ... (can you
delete topics you stated yourself so i can hang my head in shame?)


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=473653


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying one userform from another


Thanks cush. My code is certainly in the right place, associated with
the correct button on the userform ... Here is the code associated with
the button

Code:
--------------------

Private Sub CommandButton1_Click()
' store data on variables worksheet
Worksheets("variables").Range("curinitials").Value = initials.Value
Worksheets("variables").Range("curbarcpref").Value = barcpref.Value
Worksheets("variables").Range("curbarcfin").Value = barcfin.Value

' hide first step userform
Box_details.Hide

'show secondstep userform
box_contents.Show
End Sub

--------------------


Box_details is the first userform (on which CommandButton1 is located),
box_contents is the userform for the next step. The code dies at the
"box_contents.Show" point.


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=473653



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying one userform from another


FIXED

.... it was an error in the initialize routine for the second
userform!!! The code broke at the command button point and not in the
initialization script, which led me to think it was the display that
was the problem!

So sorry to have wasted all your time, (as he shrinks back in the
corner feeling very embarrassed!). It is however annoying that it broke
at the command button point, and not the point in the initializer
routine that was the problem! Made tracking the error very difficult!


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=473653

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform for displaying values from a row jgmiddel Excel Discussion (Misc queries) 0 April 25th 06 09:00 PM
PROBLEM DISPLAYING USERFORM [email protected] Excel Programming 1 May 9th 05 01:11 PM
UserForm Toolbox displaying Otto Moehrbach[_6_] Excel Programming 3 October 17th 04 12:47 AM
displaying picture in a userform Todd Huttenstine[_3_] Excel Programming 1 January 28th 04 02:42 AM
Displaying progress on UserForm Nigel Stevens Excel Programming 1 July 9th 03 01:55 PM


All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"