Reset Hyperlink on a button

vrk1219

Registered User.
Local time
Today, 15:19
Joined
Mar 13, 2009
Messages
45
Hi,
I have used Hyperlink property for a button to open an excel file.
But even after opening the same the button's hyperlink property is not being reset. The code is as follows:

/*After data is inserted into a table, generateing a CSV from it, then opening the CSV. */



tableName:="Temp_Table", _
filename:=outputPath & filename, HasFieldNames:=-1

MsgBox "The File name is: " & filename & vbCrLf & _
"Please check under" & outputPath
Me.CommandBtn.HyperlinkAddress = path & filename


Even after this code gets executed, (and the file opens) if I move mouse cursor on the button, it is still showing as a Hyperlink.

Please help me how I can make the button to be shown as a normal button, once the CSV opens.

Thanks
RK Veluvali
 
Not something I've tried myself, but it would help if you showed the code that opens the file.

At a guess, you need to make sure you set the button's HyperlinkAddress="" once you no longer want it to be a hyperlink.
 
Hi,
I tried that option, but if I give
Me.Command3.HyperlinkAddress = ""
The CSV file is not getting opened. :(

Please help.

Regards
RK Veluvali
 
Let's work this through...

You set up a button as a hyperlink.
Once your user has clicked the button, you want to remove the hyperlink.

Is this correct?

Presumably if you set the hyperlink address to "" on the OnClick event, it changes it before the link is opened, yes? If so then maybe you need to investigate the other events, eg LostFocus. Alternatively, your OnClick code needs to open the link and then reset the address, to make sure they're done in order.
 
Hi Kafrin,
I set the hyderlinkaddress to balnk in the OnExit event.
It worked. Thanks a lot

Regards
RK Veluvali
 

Users who are viewing this thread

Back
Top Bottom