I am pulling images off a CD to link into a table. I am using the following code:
Private Sub Command3_Click()
On Error Resume Next
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
This code is actually used as an event procedure of a button. I have had it link before from a cd. I changed the code to add the DIR() function. However, now it will not link off the CD. What can I do?
Thanks Keith
Private Sub Command3_Click()
On Error Resume Next
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
This code is actually used as an event procedure of a button. I have had it link before from a cd. I changed the code to add the DIR() function. However, now it will not link off the CD. What can I do?
Thanks Keith