Hi,
I have a problem with my event procedure:
Private Sub Command3_Click()
On Error Resume next
Dim FilePath As String
Dim FileExt As String
FilePath = "e:\"
FileExt = ".jpg"
Do While Not IsNull(Me!ID)
Me!Pict.SourceDoc = FilePath & Me!ID & FileExt
Me!Pict.Action = acOLECreateLink
DoCmd.GoToRecord
Loop
End Sub
The Event procedure provides a link to an image on the CD to a corresponding table field ID. Which will then print out an ID card. For files that exist on the CD, it will link it. However, when the image does not exist on the CD, it will place the next number in line. For instance, the student ID is 1234. If there is no 1234.jpg but a 1235.jpg on the cd, it will put that next file number 1235.jpg in its place. Is there any way that I can have it skip the linking of a record where there is no corresponding file for that ID?
Keith
I have a problem with my event procedure:
Private Sub Command3_Click()
On Error Resume next
Dim FilePath As String
Dim FileExt As String
FilePath = "e:\"
FileExt = ".jpg"
Do While Not IsNull(Me!ID)
Me!Pict.SourceDoc = FilePath & Me!ID & FileExt
Me!Pict.Action = acOLECreateLink
DoCmd.GoToRecord
Loop
End Sub
The Event procedure provides a link to an image on the CD to a corresponding table field ID. Which will then print out an ID card. For files that exist on the CD, it will link it. However, when the image does not exist on the CD, it will place the next number in line. For instance, the student ID is 1234. If there is no 1234.jpg but a 1235.jpg on the cd, it will put that next file number 1235.jpg in its place. Is there any way that I can have it skip the linking of a record where there is no corresponding file for that ID?
Keith