PC Review


Reply
Thread Tools Rate Thread

Change one label in another form

 
 
Scott
Guest
Posts: n/a
 
      25th Aug 2009
I want to change a label in another form based on the user input from the
main form. Here is what I have tried but failed:
On the main form, the user choose "Good morning", "Good afternoon" or "Good
evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
form is closed and another form, say UserForm1 is called. I want one label on
UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
the input of the main form. On the main form I tried
UserForm1.show
UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
The form UserForm1 pop up, but nothing happens to the label.

I'll appreciate your help.
 
Reply With Quote
 
 
 
 
Sam Wilson
Guest
Posts: n/a
 
      25th Aug 2009
Can you put

Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value

In the initialize event for UserForm1?


"Scott" wrote:

> I want to change a label in another form based on the user input from the
> main form. Here is what I have tried but failed:
> On the main form, the user choose "Good morning", "Good afternoon" or "Good
> evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
> form is closed and another form, say UserForm1 is called. I want one label on
> UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
> the input of the main form. On the main form I tried
> UserForm1.show
> UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
> The form UserForm1 pop up, but nothing happens to the label.
>
> I'll appreciate your help.

 
Reply With Quote
 
Scott
Guest
Posts: n/a
 
      25th Aug 2009
Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
"the initialize event for UserForm1"

What's "the initialize event"? I just use "UserForm1.show" and the form
comes up. You mean I need "the initialize event"? And how to do that?

Many thanks.


"Sam Wilson" wrote:

> Can you put
>
> Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value
>
> In the initialize event for UserForm1?
>
>
> "Scott" wrote:
>
> > I want to change a label in another form based on the user input from the
> > main form. Here is what I have tried but failed:
> > On the main form, the user choose "Good morning", "Good afternoon" or "Good
> > evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
> > form is closed and another form, say UserForm1 is called. I want one label on
> > UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
> > the input of the main form. On the main form I tried
> > UserForm1.show
> > UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
> > The form UserForm1 pop up, but nothing happens to the label.
> >
> > I'll appreciate your help.

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      25th Aug 2009
From VBE window; from the left treevew right click the UserForm icon and View
Code. From the code panel 1st drop down select User form and form the second
drop down select Initialize event..1st drop down shows the controls and 2nd
one its events..

If this post helps click Yes
---------------
Jacob Skaria


"Scott" wrote:

> Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
> "the initialize event for UserForm1"
>
> What's "the initialize event"? I just use "UserForm1.show" and the form
> comes up. You mean I need "the initialize event"? And how to do that?
>
> Many thanks.
>
>
> "Sam Wilson" wrote:
>
> > Can you put
> >
> > Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value
> >
> > In the initialize event for UserForm1?
> >
> >
> > "Scott" wrote:
> >
> > > I want to change a label in another form based on the user input from the
> > > main form. Here is what I have tried but failed:
> > > On the main form, the user choose "Good morning", "Good afternoon" or "Good
> > > evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
> > > form is closed and another form, say UserForm1 is called. I want one label on
> > > UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
> > > the input of the main form. On the main form I tried
> > > UserForm1.show
> > > UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
> > > The form UserForm1 pop up, but nothing happens to the label.
> > >
> > > I'll appreciate your help.

 
Reply With Quote
 
Scott
Guest
Posts: n/a
 
      25th Aug 2009
Sam and Jacob, thank you both a lot. Problem is solved.

"Jacob Skaria" wrote:

> From VBE window; from the left treevew right click the UserForm icon and View
> Code. From the code panel 1st drop down select User form and form the second
> drop down select Initialize event..1st drop down shows the controls and 2nd
> one its events..
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Scott" wrote:
>
> > Sam, thanks a lot for you answer. I am not a programmer. I'm confused on
> > "the initialize event for UserForm1"
> >
> > What's "the initialize event"? I just use "UserForm1.show" and the form
> > comes up. You mean I need "the initialize event"? And how to do that?
> >
> > Many thanks.
> >
> >
> > "Sam Wilson" wrote:
> >
> > > Can you put
> > >
> > > Me.Label1.Caption = Sheets("Sheet1").Range("A1").Value
> > >
> > > In the initialize event for UserForm1?
> > >
> > >
> > > "Scott" wrote:
> > >
> > > > I want to change a label in another form based on the user input from the
> > > > main form. Here is what I have tried but failed:
> > > > On the main form, the user choose "Good morning", "Good afternoon" or "Good
> > > > evening". The content is linked to a cell (say "A1") on Sheet1. Then the main
> > > > form is closed and another form, say UserForm1 is called. I want one label on
> > > > UserForm1 to show "Good morning", "Good afternoon" or "Good evening" based on
> > > > the input of the main form. On the main form I tried
> > > > UserForm1.show
> > > > UserForm1.Label1.Caption= Sheets("Sheet1").Range("A1").Value
> > > > The form UserForm1 pop up, but nothing happens to the label.
> > > >
> > > > I'll appreciate your help.

 
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
Change the text of a label on a modal form Nicholas Scarpinato Microsoft Access Form Coding 5 12th Feb 2008 03:16 PM
How to change label.text from on form in another form =?Utf-8?B?THVpcyBSYW1vcw==?= Microsoft VB .NET 5 13th Oct 2005 07:34 PM
change label on form =?Utf-8?B?UmF5IE1lYWQ=?= Microsoft Access VBA Modules 3 22nd Jun 2005 05:15 PM
Change label text on another form Roger Ries via DotNetMonster.com Microsoft VB .NET 3 28th Feb 2005 10:15 PM
Change caption of a label on a form =?Utf-8?B?QW5kcmV3?= Microsoft Access VBA Modules 1 31st May 2004 05:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:51 PM.