Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Label on User Form visible

I have what I think is an easy one, but I'm stuck.

I have a user form were the user is required to make selections in 3
fields, 2 comboboxes and 1 text box. I've placed a label above all
three. The first one is set to visible.true, the other two set to
visible.false. The first one has text: "Enter Origin First". When
the user selects an item from combobox1, then set label1 to
visible.false, and label2 visible.true and so on...kind of like having
a bit of instruction as the user moves from one field to the next.

I've tried code in the label something like:

private sub label1_click()
if combobox.text < "" then
label1.visible = False
End if

Nothing happens tho, any suggestions?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Label on User Form visible


I used .hide on one of my programs and it worked. Yoou don't need the =
False

Hide and Visiabble should work

The hide shouldn't be against the label, it should be on the textbox.

"Gimp" wrote:

I have what I think is an easy one, but I'm stuck.

I have a user form were the user is required to make selections in 3
fields, 2 comboboxes and 1 text box. I've placed a label above all
three. The first one is set to visible.true, the other two set to
visible.false. The first one has text: "Enter Origin First". When
the user selects an item from combobox1, then set label1 to
visible.false, and label2 visible.true and so on...kind of like having
a bit of instruction as the user moves from one field to the next.

I've tried code in the label something like:

private sub label1_click()
if combobox.text < "" then
label1.visible = False
End if

Nothing happens tho, any suggestions?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Label on User Form visible

I am not sure what Joel is working with, but I didn't see a hide property or
method for labels used on Userforms.

Private Sub Userform_Initialize()
Label1.Visible = True
Label2.Visible = False
Label3.Visible = False
End sub

Private Sub Combobox1_Click()
Label1.Visible = False
Label2.Visible = True
Label3.Visible = False
End Sub

Private Sub Combobox2_Click()
Label1.Visible = False
Label2.Visible = False
Label3.Visible = True
End Sub


Private Sub Textbox1_Exit()
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
End Sub

This only works if the user moves sequentially through your data as you
expect. You could also hide the related controls (you don't want selected)
as well using the same approach.

--
Regards,
Tom Ogilvy


"Gimp" wrote:

I have what I think is an easy one, but I'm stuck.

I have a user form were the user is required to make selections in 3
fields, 2 comboboxes and 1 text box. I've placed a label above all
three. The first one is set to visible.true, the other two set to
visible.false. The first one has text: "Enter Origin First". When
the user selects an item from combobox1, then set label1 to
visible.false, and label2 visible.true and so on...kind of like having
a bit of instruction as the user moves from one field to the next.

I've tried code in the label something like:

private sub label1_click()
if combobox.text < "" then
label1.visible = False
End if

Nothing happens tho, any suggestions?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Label on User Form visible

On Feb 14, 1:27 pm, Tom Ogilvy
wrote:
I am not sure what Joel is working with, but I didn't see a hide property or
method for labels used on Userforms.

Private Sub Userform_Initialize()
Label1.Visible = True
Label2.Visible = False
Label3.Visible = False
End sub

Private Sub Combobox1_Click()
Label1.Visible = False
Label2.Visible = True
Label3.Visible = False
End Sub

Private Sub Combobox2_Click()
Label1.Visible = False
Label2.Visible = False
Label3.Visible = True
End Sub

Private Sub Textbox1_Exit()
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
End Sub

This only works if the user moves sequentially through your data as you
expect. You could also hide the related controls (you don't want selected)
as well using the same approach.

--
Regards,
Tom Ogilvy



"Gimp" wrote:
I have what I think is an easy one, but I'm stuck.


I have a user form were the user is required to make selections in 3
fields, 2 comboboxes and 1 text box. I've placed a label above all
three. The first one is set to visible.true, the other two set to
visible.false. The first one has text: "Enter Origin First". When
the user selects an item from combobox1, then set label1 to
visible.false, and label2 visible.true and so on...kind of like having
a bit of instruction as the user moves from one field to the next.


I've tried code in the label something like:


private sub label1_click()
if combobox.text < "" then
label1.visible = False
End if


Nothing happens tho, any suggestions?


Thanks- Hide quoted text -


- Show quoted text -


Thanks...Yep, I got it. I did not see the HIDE option either but just
switched my code from the label to the combox boxes....all good. And
yes, I'm gonna play around with using this on the combo boxes instead
of the labels...want to make sure it looks OK...thanks again...!

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
COPY LABEL FORM FROM EXCEL TO A LABEL xrayAndi New Users to Excel 1 March 5th 06 02:21 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
Label Scroll Bar Properties: Make Visible? Mcasteel[_44_] Excel Programming 0 November 15th 04 02:52 PM
Refresh label on user form with RefEdit John Tjia Excel Programming 2 January 6th 04 10:12 PM


All times are GMT +1. The time now is 07:18 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"