My Assistant
![]() ![]() |
|
|
May 4 2012, 03:15 AM
Post
#1
|
|
|
New Member Posts: 2 |
Hi,
I have a problem using a button on a report opening an excel file. When hardcoding the hyperlink the required document opens but when reading the path & filename from a table storing all paths and filenames it doesn't open the file. (Path and filename are on the report in when using: Me.button.HyperlinkAddress = "C:\Local files\filename.xls" the excel file filename.xls opens When using: dim strlink as string strLink = Chr$(34) & Me.path.Value & Me.DocName.Value & Chr$(34) Me.button.HyperlinkAddress = strLink strLink holds the same refference "C:\Local files\filename.xls" as when using the address hardcoded... I get the message that the file cannot be opened??? What am I doing wrong??? |
|
|
|
May 4 2012, 06:12 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 5,278 From: Upstate NY, USA |
You do not need to enclose Me.path.Value & Me.DocName.Value in quotes. You are not building
an SQL statement. Drop the Chr$(34) assignments. With Me.button.HyperlinkAddress = "C:\Local files\filename.xls" quotes are needed because you are assigning a literal string to a variable. With strLink = Me.path.Value & Me.DocName.Value you assigning the combination of two variables to a third variable and then to the property of a class. |
|
|
|
May 4 2012, 06:51 AM
Post
#3
|
|
|
New Member Posts: 2 |
So simple but so hard to spot the error.
Thanks a lot, I just didn't "see" my obvious mistake... |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 06:23 AM |