View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gimp Gimp is offline
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...!