hyperlink

P

Pietro

Hi all,
In the click event of a button,i have input the following code:If [Language]
= "Greek" Then Command48.HyperlinkAddress = "\\10.43.0.132\Company\MSKB\Auto
Reply\Greek.doc"
If [Language] = "Hebrew" Then Command48.HyperlinkAddress =
"\\10.43.0.132\Company\MSKB\Auto Reply\Hebrew.doc"
Now i need urgently that if [language] is something else other than "greek"
or "hebrew" the hyperlink is deleted..
 
S

storrboy

Hi all,
In the click event of a button,i have input the following code:If [Language]
= "Greek" Then Command48.HyperlinkAddress = "\\10.43.0.132\Company\MSKB\Auto
Reply\Greek.doc"
If [Language] = "Hebrew" Then Command48.HyperlinkAddress =
"\\10.43.0.132\Company\MSKB\Auto Reply\Hebrew.doc"
Now i need urgently that if [language] is something else other than "greek"
or "hebrew" the hyperlink is deleted..


Have you tried setting it to an empty string?

Command48.HyperlinkAddress = ""
 
P

Pietro

Yes I did,
But it gives me an error message.

storrboy said:
Hi all,
In the click event of a button,i have input the following code:If [Language]
= "Greek" Then Command48.HyperlinkAddress = "\\10.43.0.132\Company\MSKB\Auto
Reply\Greek.doc"
If [Language] = "Hebrew" Then Command48.HyperlinkAddress =
"\\10.43.0.132\Company\MSKB\Auto Reply\Hebrew.doc"
Now i need urgently that if [language] is something else other than "greek"
or "hebrew" the hyperlink is deleted..


Have you tried setting it to an empty string?

Command48.HyperlinkAddress = ""
 
S

storrboy

Interesting, what error message? When I try it, it just does nothing
as you'd expect it to with the address set to "". Are you using the a
form reference? Either Forms("frmName"). or Me! in front of Command48
(I forgot to type that in my first response).
 
P

Pietro

the error message " Type mismatch",and here's the exact thing i use :
If [Language]
= "Greek" Then Command48.HyperlinkAddress = "\\10.43.0.132\Company\MSKB\Auto
Reply\Greek.doc"
If [Language] = "Hebrew" Then Command48.HyperlinkAddress =
"\\10.43.0.132\Company\MSKB\Auto Reply\Hebrew.doc"
 
S

storrboy

If [Language] is a textbox or other control on a form then your usage
won't work. Nor will it work by only citing Command48. whatever. Also,
if you have many If statements to deal with it may be better to use a
Select Case statement.

Dim urlAdd As String
Select Case Me!Language
Case "Greek"
urlAdd = "\\10.43.0.132\Company\MSKB\Auto Reply\Greek.doc"
Case "Hebrew"
urlAdd = "\\10.43.0.132\Company\MSKB\Auto Reply\Hebrew.doc"
Case Else
urlAdd = ""
End Select

Me!Command48.HyperlinkAddress = urlAdd
 
Top