P
paul bennett
This is the VB code for two image frames on a report. The frames display an
image of a location based on a site number, which is also the image filename.
This works just fine on my version of Access (2002), but will not work when
the database is opened with Access 2003.
The same form of code is used to pull the images into a form, which works
fine in both versions.
The error is "invalid arguement, call or function"
Any ideas as to what is causing this?
.....................................................................................
Private Sub detail_format(cancel As Integer, formatcount As Integer)
Dim theDbFullPath As String
theDbFullPath = CurrentDb.Name
Dim theDbFile As String
theDbFile = Dir(theDbFullPath)
theDbFolder = Left$(theDbFullPath, Len(theDbFullPath) - Len(theDbFile))
thePhoto = Me.DATASiteNumber.Value
thePhotoPath = theDbFolder & "GazetteerPhotos\" & thePhoto & ".jpg"
theMapPath = theDbFolder & "GazetteerMaps\" & thePhoto & ".jpg"
theblankpath = theDbFolder & "GazetteerPhotos\" & "Blank.jpg"
If Dir(thePhotoPath) = "" Then
Me.ImgPhoto1.Picture = theblankpath
Else
Me.ImgPhoto1.Picture = thePhotoPath
End If
If Dir(theMapPath) = "" Then
Me.ImgPhoto2.Picture = theblankpath
Else
Me.ImgPhoto2.Picture = theMapPath
End If
End Sub
..................................................................................................
image of a location based on a site number, which is also the image filename.
This works just fine on my version of Access (2002), but will not work when
the database is opened with Access 2003.
The same form of code is used to pull the images into a form, which works
fine in both versions.
The error is "invalid arguement, call or function"
Any ideas as to what is causing this?
.....................................................................................
Private Sub detail_format(cancel As Integer, formatcount As Integer)
Dim theDbFullPath As String
theDbFullPath = CurrentDb.Name
Dim theDbFile As String
theDbFile = Dir(theDbFullPath)
theDbFolder = Left$(theDbFullPath, Len(theDbFullPath) - Len(theDbFile))
thePhoto = Me.DATASiteNumber.Value
thePhotoPath = theDbFolder & "GazetteerPhotos\" & thePhoto & ".jpg"
theMapPath = theDbFolder & "GazetteerMaps\" & thePhoto & ".jpg"
theblankpath = theDbFolder & "GazetteerPhotos\" & "Blank.jpg"
If Dir(thePhotoPath) = "" Then
Me.ImgPhoto1.Picture = theblankpath
Else
Me.ImgPhoto1.Picture = thePhotoPath
End If
If Dir(theMapPath) = "" Then
Me.ImgPhoto2.Picture = theblankpath
Else
Me.ImgPhoto2.Picture = theMapPath
End If
End Sub
..................................................................................................