CurrentProject.Path

N

nomadk

Thanks to Arvin Meyer I have this public function:

Public Function ImagePath()
Dim strPath As String

strPath = CurrentProject.Path & "\Graphics"

End Function

In the OnCurrent event of frmLogin I'm calling it using:

Private Sub Form_Current()
Me.imgCheck.Picture = ImagePath() & "\Check.bmp\"
Me.imgCancel.Picture = ImagePath() & "\Cancel.bmp\"
End Sub

When I open frmLogin I get the error:

Microsoft Office Access can't open the file 'C:\Documents and
Settings\User1\My Documents\Contact Manager\A. New
Version\PSSContactManagerOutlookInterface\Check.bmp'.

(and a second error for Cancel.bmp as well)

The path is correct and the files are there. Am I missing quotes or something?

Thanks
 
N

nomadk

More info:

I realize now that the path in the error message is the one stored in the
Properties setting of each image control on the form. I thought the function
would fire first and replace the old path.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top