Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then Statement

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
I have a label that i am trying to have go to a different URL depending on what a combo box value is. I have the following working:

Code:
If Text101.Value = "PC" Then
Label39.HyperlinkAddress = "[URL unfurl="true"]http://www.google.com"[/URL]
End If
If Text101.Value = "HT" Then
Label39.HyperlinkAddress = "[URL unfurl="true"]http://www.cnn.com"[/URL]
End If

What i cannot figure out is how to do the following....if the value is anything other than "pc" or "ht" then nothing happens when it is clicked.

Any suggestions?

Paul
 
Like this ?
Code:
If Text101.Value = "PC" Then
  Label39.HyperlinkAddress = "[URL unfurl="true"]http://www.google.com"[/URL]
ElseIf Text101.Value = "HT" Then
  Label39.HyperlinkAddress = "[URL unfurl="true"]http://www.cnn.com"[/URL]
Else
  Label39.HyperlinkAddress = ""
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV! I tried almost exactly that but didn't have the Elseif in there. Thanks you that worked perfectly!
 

It seems to me that your original code should have done nothing if you didn't have either of those values entered.
What problem were you having?


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top