Open File based on parameter pass

S

Shawna

I would like to have a hyperlink to open a file based on the record primary
key the user is currently sitting on. Can this be done?
i.e. on Record No 3456 open File in a specified directory file name 3456.doc

Thanks in advance
 
J

John Nurick

Hi Shawna,

Assuming the record is being displayed in a form and the primary key
being displayed in a textbox called txtPK, try something like this in
the Click() event procedure of a commandbutton:

Application.FollowHyperlink "C:\Folder\" & Me.txtPK.Value & ".doc"
 
Top