I have some code below that is called on Current Event of page, So when i refresh the page, the code automatically looks at the CatNo. and pulls back the picture from the network Drive, to a local drive, and it it cannot find the network drive - it justs gives me a No Picture.jpg.
I would like to change this so that instead of running on current, it looks at all jobs raised within the last week and copies the pictures over.
Where do i start.
I would like to change this so that instead of running on current, it looks at all jobs raised within the last week and copies the pictures over.
Where do i start.
Code:
GetPicture Nz(tbCatNo, "")
Code:
Sub GetPicture(CatNo As String)
On Error GoTo Handler
Dim PicPath As String
Dim sURL As String
Dim sLocalFile As String
Dim sLocalFile1 As String
Dim i As Integer
sLocalFile = Environ("Temp") & "\QAPic.jpg"
sLocalFile1 = ImagePath1 & CatNo & ".jpg"
PicPath = ImagePath & CatNo & ".jpg"
If Dir(PicPath) <> "" Then
SaveFile PicPath, sLocalFile1
Else
SaveFile CurrentProject.Path & "\nopicture.jpg", sLocalFile
End If
imgWeb.Picture = sLocalFile1
DoEvents
Exit Sub
Handler:
If Err.Number = 70 Then Exit Sub
If Err.Number = 2220 Then
imgWeb.Picture = sLocalFile
Resume Next
End If
Call LogError(Err.Number, Err.Description, "GetPicture 22", tbJobID)
Forms!Frmmain.Visible = True
Exit Sub
End Sub