Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open And Close Form

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Open And Close Form

One way is to resize the form to fit the screen.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Open And Close Form

For Q.2.

Private Sub CommandButton1_Click()
UserForm 2.Show
Unload Me
End Sub

Private Sub CommandButton1_Click()
UserForm 1.Show
Unload Me
End Sub

The first one goes behind the command button on userform 1. The second one
goes behind the command button on userform 2.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open And Close Form

Hi JLGWhiz,

Thanks for the reply, I did think about that but it would leave me with a
lot of blank space around my Form would prefer to keep the form the size it
is and some way hide the form.

Thanks

"JLGWhiz" wrote:

One way is to resize the form to fit the screen.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open And Close Form

Hi JLGWhiz,

Thats brilliant thanks, thought it would be something like that, must be
that Friday feeling.

Thanks Phil

"JLGWhiz" wrote:

For Q.2.

Private Sub CommandButton1_Click()
UserForm 2.Show
Unload Me
End Sub

Private Sub CommandButton1_Click()
UserForm 1.Show
Unload Me
End Sub

The first one goes behind the command button on userform 1. The second one
goes behind the command button on userform 2.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open And Close Form

Hi JLGWhiz,

Should of tried this first I think before my last comment, I have put the
buttons in but when I click button 1, it opens the 2nd form but does not shut
the 1st, thus when you click the button on the 2nd form it crash's because
form 1 has still not shut, do you have any other thoughts.

Thanks Phil

"tress" wrote:

Hi JLGWhiz,

Thats brilliant thanks, thought it would be something like that, must be
that Friday feeling.

Thanks Phil

"JLGWhiz" wrote:

For Q.2.

Private Sub CommandButton1_Click()
UserForm 2.Show
Unload Me
End Sub

Private Sub CommandButton1_Click()
UserForm 1.Show
Unload Me
End Sub

The first one goes behind the command button on userform 1. The second one
goes behind the command button on userform 2.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open And Close Form

Sorry, I have sorted it, the Unload Me had to come before the Show Form.

Thanks

"tress" wrote:

Hi JLGWhiz,

Thats brilliant thanks, thought it would be something like that, must be
that Friday feeling.

Thanks Phil

"JLGWhiz" wrote:

For Q.2.

Private Sub CommandButton1_Click()
UserForm 2.Show
Unload Me
End Sub

Private Sub CommandButton1_Click()
UserForm 1.Show
Unload Me
End Sub

The first one goes behind the command button on userform 1. The second one
goes behind the command button on userform 2.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Open And Close Form

For question 2, I would have used this behind userform1's commandbutton1:

Option Explicit
Private Sub CommandButton1_Click()
Me.Hide
UserForm2.Show
Me.Show
End Sub


And this behind userform2's commandbutton1:
Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub

For question 1, what do you want the users to see instead. Maybe you can keep
that worksheet that gets updated hidden -- or show a different worksheet before
you show the form????


tress wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Open And Close Form

yes, I have these senior moments when things end up backwards. Glad you
worked it out.

"tress" wrote:

Sorry, I have sorted it, the Unload Me had to come before the Show Form.

Thanks

"tress" wrote:

Hi JLGWhiz,

Thats brilliant thanks, thought it would be something like that, must be
that Friday feeling.

Thanks Phil

"JLGWhiz" wrote:

For Q.2.

Private Sub CommandButton1_Click()
UserForm 2.Show
Unload Me
End Sub

Private Sub CommandButton1_Click()
UserForm 1.Show
Unload Me
End Sub

The first one goes behind the command button on userform 1. The second one
goes behind the command button on userform 2.

"tress" wrote:

Hi,

I have done most of the complicated parts of this task but seem to be
getting stuck on what I thought would be the simple part.

I am using Excel 2003 in a Windows NT Enviroment

Question 1

I have an Excel Document, that when you open it, it Shows the Form that I
have built but with the Excel sheet behind it, what I want is just to see
the form, I think the problem lies with when you click the ok button it
writes data from the form to the excel sheet I still want this to happen, I
just dont want the user to see this.

Question 2

I have 2 forms, what I want to do is have a button on the first form that
takes you to the second but closes the first, then a button on the second
that takes you back to the first and shuts the second.

Can anyone help with this or point me in the right direction?

Thanks

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
Call user form from ThisWorkbook; close file if form closed XP Excel Programming 2 July 20th 07 07:04 PM
How do I close form PeterW Excel Programming 3 March 31st 07 12:50 PM
close .chm with form ckoch Excel Programming 2 May 9th 06 07:49 PM
Open Only the User Form ... or Close Everything ! monir Excel Programming 4 April 2nd 06 09:30 PM
Close Form with VBA William C. Smith Excel Programming 3 September 2nd 03 05:28 AM


All times are GMT +1. The time now is 02:54 AM.

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

About Us

"It's about Microsoft Excel"