If you're using A2K or later, you can use
objLic.ProductImage = CurrentProject.Path & "\" & strImage
If you're using A97, you have to start with CurrentDb.Name and parse
the path out of it. There's a cute trick to doing it with the Dir()
function, but I won't bother to post it unless you need it.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Quote:
> I wish to reference an image file that is in the same
> directory as the MS acccess application that is
> distributed using a standard setup - Given the
> uncertainties of set up I do not know this directory in
> advance.
> How do I reference the file?
> I have tried:
> If Right(App.Path, 1) = "\" Then
> objLic.ProductImage = App.Path & strImage
> Else
> objLic.ProductImage = App.Path & "\" & strImage
> End If
> where objLic is an object whose property I am trying to
> set, and where strImage is a string variable that
> contains the file name.
> This formulation works in VB6, but in access vb I am told
> that I do not have the object - am I missing a library or
> is there another object in access that I should be using?