dixie wrote:
Thanks Helen (lover your pseudonym). That worked of course. Is there any
way to do a DLookup of the file name you want to open, as it will vary and
users are using an mde. I tried it in the HyperlinkAddress property, but it
wouldn't accept it there, so I am assuming there may be some code that can
achieve that.
dixie
What, you don't think my mother really named me that? :)
You can still use the HyperlinkAddress property, but you'll need
to use a little code to set the property at run time instead of
typing it in the form design view. Only a very little code though.
I'd create a function something like this in the form's code
module (watch out for possible word wrapping here):
Private Function set_my_link()
Me![mybutton].HyperlinkAddress = _
Nz(DLookup("[filename]", "[my_files_table]", _
"[my_files_table].[id]=" & Me![id]), "")
End Function
Then I'd decide which form events should cause the button's
hyperlink to be updated. A likely candidate would be the form's
Current event, so I'd enter this in the form's OnCurrent
property:
=set_my_link()
that should do the trick for you.
Cheers