I have written a program that links images into a database to create ID cards for school pictures. It linked images. However, when an id did not exist on the CD, the next image in order on the CD was put in its place, i.e no 1.jpg on CD but 2.jpg does and is place in the record for 1. I tried to use DIr() I get "OLE Server does not support linking. The code will not link at all now. This is the code with the DIR() function:
Private Sub Command3_Click()
'On Error GoTo Errorhandler
Dim FilePath As String
Dim FileExt As String
Dim try As String
Dim final As String
FilePath = "e:\"
FileExt = ".jpg"
Do While Not IsNull(Me!ID)
flnm = Me!ID & FileExt
final = Dir(FilePath & flnm)
If final <> "" Then
Me!Pict.SourceDoc = FilePath & flnm
Me!Pict.Action = acOLECreateLink
DoCmd.GoToRecord
Else
DoCmd.GoToRecord , , acNext
End If
Loop
End Sub
What can I add either in Reference libraries or code to have it link from the CD-Rom.
Thanks, Keith
Private Sub Command3_Click()
'On Error GoTo Errorhandler
Dim FilePath As String
Dim FileExt As String
Dim try As String
Dim final As String
FilePath = "e:\"
FileExt = ".jpg"
Do While Not IsNull(Me!ID)
flnm = Me!ID & FileExt
final = Dir(FilePath & flnm)
If final <> "" Then
Me!Pict.SourceDoc = FilePath & flnm
Me!Pict.Action = acOLECreateLink
DoCmd.GoToRecord
Else
DoCmd.GoToRecord , , acNext
End If
Loop
End Sub
What can I add either in Reference libraries or code to have it link from the CD-Rom.
Thanks, Keith