PC Review


Reply
Thread Tools Rate Thread

Checking to see if a user form is hidden

 
 
Alteran
Guest
Posts: n/a
 
      27th Nov 2009
I am trying to find a way that I can hide a userform open a seconday one, and
once I close the other one it will check through 3 userforms to find which
one is hidden and show it.

What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
and a secondary userform with a different function: ufCont

What I have is on each of the main user forms they have a button that hides
the form that is loaded, opens ufCont, allows the user to finish their input
and post it to the sheet, however when i hit the close button cmbClose I want
it to check if the main forms are just hidden (not unloaded) and go back to
the form they where working on.

Is this at all do-able?
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      27th Nov 2009
Just put this in each of your main UserForm's Button's click events...

Me.Hide
ufCont.Show
Me.Show

The current UserForm will be hidden and the ufCont one will be shown... when
you close the ufCont UserForm, the UserForm whose button you clicked should
automatically be re-shown.

--
Rick (MVP - Excel)


"Alteran" <(E-Mail Removed)> wrote in message
news:5B82CF64-6567-4B68-B883-(E-Mail Removed)...
>I am trying to find a way that I can hide a userform open a seconday one,
>and
> once I close the other one it will check through 3 userforms to find which
> one is hidden and show it.
>
> What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
> and a secondary userform with a different function: ufCont
>
> What I have is on each of the main user forms they have a button that
> hides
> the form that is loaded, opens ufCont, allows the user to finish their
> input
> and post it to the sheet, however when i hit the close button cmbClose I
> want
> it to check if the main forms are just hidden (not unloaded) and go back
> to
> the form they where working on.
>
> Is this at all do-able?


 
Reply With Quote
 
Alteran
Guest
Posts: n/a
 
      27th Nov 2009
Ok thanks Rick, that part worked, However I am trying to pass a value from
the ufMain1 to the ufCont, its not working this is the code I am using:

Private Sub cmdContract_Click()
Me.Hide
frmCont.Show
Sheets("Cont").Select
Range("B1").Select
Me.Show
Sheets("W510").Select
Range("B1").Select
frmContract.tbItem.Value = frmInputW510.tbItemNum.Value
End Sub

Is there something else I Should be doing here?

-Alt

"Rick Rothstein" wrote:

> Just put this in each of your main UserForm's Button's click events...
>
> Me.Hide
> ufCont.Show
> Me.Show
>
> The current UserForm will be hidden and the ufCont one will be shown... when
> you close the ufCont UserForm, the UserForm whose button you clicked should
> automatically be re-shown.
>
> --
> Rick (MVP - Excel)
>
>
> "Alteran" <(E-Mail Removed)> wrote in message
> news:5B82CF64-6567-4B68-B883-(E-Mail Removed)...
> >I am trying to find a way that I can hide a userform open a seconday one,
> >and
> > once I close the other one it will check through 3 userforms to find which
> > one is hidden and show it.
> >
> > What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
> > and a secondary userform with a different function: ufCont
> >
> > What I have is on each of the main user forms they have a button that
> > hides
> > the form that is loaded, opens ufCont, allows the user to finish their
> > input
> > and post it to the sheet, however when i hit the close button cmbClose I
> > want
> > it to check if the main forms are just hidden (not unloaded) and go back
> > to
> > the form they where working on.
> >
> > Is this at all do-able?

>
> .
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      27th Nov 2009
Maybe...

frmCont.tbItem.Value = me.tbItemNum.Value



Alteran wrote:
>
> Ok thanks Rick, that part worked, However I am trying to pass a value from
> the ufMain1 to the ufCont, its not working this is the code I am using:
>
> Private Sub cmdContract_Click()
> Me.Hide
> frmCont.Show
> Sheets("Cont").Select
> Range("B1").Select
> Me.Show
> Sheets("W510").Select
> Range("B1").Select
> frmContract.tbItem.Value = frmInputW510.tbItemNum.Value
> End Sub
>
> Is there something else I Should be doing here?
>
> -Alt
>
> "Rick Rothstein" wrote:
>
> > Just put this in each of your main UserForm's Button's click events...
> >
> > Me.Hide
> > ufCont.Show
> > Me.Show
> >
> > The current UserForm will be hidden and the ufCont one will be shown... when
> > you close the ufCont UserForm, the UserForm whose button you clicked should
> > automatically be re-shown.
> >
> > --
> > Rick (MVP - Excel)
> >
> >
> > "Alteran" <(E-Mail Removed)> wrote in message
> > news:5B82CF64-6567-4B68-B883-(E-Mail Removed)...
> > >I am trying to find a way that I can hide a userform open a seconday one,
> > >and
> > > once I close the other one it will check through 3 userforms to find which
> > > one is hidden and show it.
> > >
> > > What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
> > > and a secondary userform with a different function: ufCont
> > >
> > > What I have is on each of the main user forms they have a button that
> > > hides
> > > the form that is loaded, opens ufCont, allows the user to finish their
> > > input
> > > and post it to the sheet, however when i hit the close button cmbClose I
> > > want
> > > it to check if the main forms are just hidden (not unloaded) and go back
> > > to
> > > the form they where working on.
> > >
> > > Is this at all do-able?

> >
> > .
> >


--

Dave Peterson
 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      27th Nov 2009
I'm not entirely clear on what you are doing here. What do the Selections
you are making have to do with passing a value to ufCont and how does
frmContract.tbItem and frmInputW510.tbItemNum have to do with what you are
attempting to do?

--
Rick (MVP - Excel)


"Alteran" <(E-Mail Removed)> wrote in message
news:404C90DA-1F96-4F37-82B8-(E-Mail Removed)...
> Ok thanks Rick, that part worked, However I am trying to pass a value from
> the ufMain1 to the ufCont, its not working this is the code I am using:
>
> Private Sub cmdContract_Click()
> Me.Hide
> frmCont.Show
> Sheets("Cont").Select
> Range("B1").Select
> Me.Show
> Sheets("W510").Select
> Range("B1").Select
> frmContract.tbItem.Value = frmInputW510.tbItemNum.Value
> End Sub
>
> Is there something else I Should be doing here?
>
> -Alt
>
> "Rick Rothstein" wrote:
>
>> Just put this in each of your main UserForm's Button's click events...
>>
>> Me.Hide
>> ufCont.Show
>> Me.Show
>>
>> The current UserForm will be hidden and the ufCont one will be shown...
>> when
>> you close the ufCont UserForm, the UserForm whose button you clicked
>> should
>> automatically be re-shown.
>>
>> --
>> Rick (MVP - Excel)
>>
>>
>> "Alteran" <(E-Mail Removed)> wrote in message
>> news:5B82CF64-6567-4B68-B883-(E-Mail Removed)...
>> >I am trying to find a way that I can hide a userform open a seconday
>> >one,
>> >and
>> > once I close the other one it will check through 3 userforms to find
>> > which
>> > one is hidden and show it.
>> >
>> > What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
>> > and a secondary userform with a different function: ufCont
>> >
>> > What I have is on each of the main user forms they have a button that
>> > hides
>> > the form that is loaded, opens ufCont, allows the user to finish their
>> > input
>> > and post it to the sheet, however when i hit the close button cmbClose
>> > I
>> > want
>> > it to check if the main forms are just hidden (not unloaded) and go
>> > back
>> > to
>> > the form they where working on.
>> >
>> > Is this at all do-able?

>>
>> .
>>


 
Reply With Quote
 
Alteran
Guest
Posts: n/a
 
      27th Nov 2009
Well what it is doing is once the first form opens the second form their is a
relation between the two forms, that is also a relation within two sheets in
the work book, this is the Item #

I think I have got this to work however by doing this:
Private Sub cmdContract_Click()
Dim frm As frmContract
Me.Hide
Set frm = New frmContract
'Transferes the value to the contract sheet.
frm.tbItem.Value = frmInputW510.tbItemNum.Value
Sheets("Contracts").Select
Range("B1").Select
frm.Show
Unload frm
Me.Show
Sheets("W510").Select
Range("B1").Select
End Sub

Thanks for the help.



"Rick Rothstein" wrote:

> I'm not entirely clear on what you are doing here. What do the Selections
> you are making have to do with passing a value to ufCont and how does
> frmContract.tbItem and frmInputW510.tbItemNum have to do with what you are
> attempting to do?
>
> --
> Rick (MVP - Excel)
>
>
> "Alteran" <(E-Mail Removed)> wrote in message
> news:404C90DA-1F96-4F37-82B8-(E-Mail Removed)...
> > Ok thanks Rick, that part worked, However I am trying to pass a value from
> > the ufMain1 to the ufCont, its not working this is the code I am using:
> >
> > Private Sub cmdContract_Click()
> > Me.Hide
> > frmCont.Show
> > Sheets("Cont").Select
> > Range("B1").Select
> > Me.Show
> > Sheets("W510").Select
> > Range("B1").Select
> > frmContract.tbItem.Value = frmInputW510.tbItemNum.Value
> > End Sub
> >
> > Is there something else I Should be doing here?
> >
> > -Alt
> >
> > "Rick Rothstein" wrote:
> >
> >> Just put this in each of your main UserForm's Button's click events...
> >>
> >> Me.Hide
> >> ufCont.Show
> >> Me.Show
> >>
> >> The current UserForm will be hidden and the ufCont one will be shown...
> >> when
> >> you close the ufCont UserForm, the UserForm whose button you clicked
> >> should
> >> automatically be re-shown.
> >>
> >> --
> >> Rick (MVP - Excel)
> >>
> >>
> >> "Alteran" <(E-Mail Removed)> wrote in message
> >> news:5B82CF64-6567-4B68-B883-(E-Mail Removed)...
> >> >I am trying to find a way that I can hide a userform open a seconday
> >> >one,
> >> >and
> >> > once I close the other one it will check through 3 userforms to find
> >> > which
> >> > one is hidden and show it.
> >> >
> >> > What i have are 3 main userforms: ufMain1, ufMain2, ufMain3
> >> > and a secondary userform with a different function: ufCont
> >> >
> >> > What I have is on each of the main user forms they have a button that
> >> > hides
> >> > the form that is loaded, opens ufCont, allows the user to finish their
> >> > input
> >> > and post it to the sheet, however when i hit the close button cmbClose
> >> > I
> >> > want
> >> > it to check if the main forms are just hidden (not unloaded) and go
> >> > back
> >> > to
> >> > the form they where working on.
> >> >
> >> > Is this at all do-able?
> >>
> >> .
> >>

>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Input on User Form to Hidden Worksheet Brian Microsoft Excel Programming 9 3rd Jan 2010 02:07 PM
checking if a column is hidden =?Utf-8?B?Sm9obg==?= Microsoft Excel Programming 3 12th Jun 2007 08:39 AM
Compile error in hidden module: [user form name] Excel/VBA Carlos Microsoft Excel Programming 1 30th Apr 2007 07:35 PM
Checking if form is hidden =?Utf-8?B?U3R1Sm9s?= Microsoft Access Forms 2 14th Sep 2006 01:46 PM
Checking the status of a checkbox in a user form =?Utf-8?B?UGV0ZXIgUm9vbmV5?= Microsoft Excel Programming 15 1st Nov 2005 03:59 PM


Features
 

Advertising
 

Newsgroups
 


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