Opening a file using ME.ID

Locopete99

Registered User.
Local time
Today, 10:17
Joined
Jul 11, 2016
Messages
163
Hi Guys.


How can I open a file using ME.[Blanket_agreement_Number] from one of my tables?

Am I right in thinking it would be along the lines of:

Code:
Dim FileName As String
Dim strpath As String
FileName = "ME.[Blanket_agreement_Number]"&".PDF"
strpath = "c:\Filepath\" & FileName

Application.FollowHyperlink strpath
 
Almost dude.

Code:
Dim FileName As String
Dim strpath As String
FileName = Me.Blanket_agreement_Number &".PDF"
strpath = "c:\Filepath\" & FileName

Application.FollowHyperlink strpath
 
it should be

FileName = ME.[Blanket_agreement_Number] &".PDF"
 
Hi Guys,

Its still bugging at the Hyperlink stage


Code:
Private Sub Command45_Click()

Dim FileName As String
Dim strpath As String
FileName = Me.[Blanket_Agreement_Number] & ".PDF"
strpath = "I:\21.Processed Shikomi Forms\" & FileName

Application.FollowHyperlink strpath
End Sub
 
still bugging means what? what error message are you getting?
 
Don't worry guys, I've figured it out.

My Blanket Agreement Number has the format "SGB"#

The first record I had is SGB1.

Once I change my file name to

FileName = "SGB" & Me.[Blanket_Agreement_Number] & ".PDF"

it works.

This has highlighted another query. If I export this to Excel for instance, would
Me.[Blanket_Agreement_Number] export as 1 or SGB1.

If just 1, is there a way to change to SGB1?

Me.[Blanket_Agreement_Number] is an autonumber with the aforementioned format on it.
 

Users who are viewing this thread

Back
Top Bottom