M
MSACSNewb
Access 2007
I am able to get my form to display a unique linked image for every record.
The image displayed is based on the name of the file stored in a text field -
[CAD FILE].
The problem I am having is that if I am on a record then go to another
record, if a file doesn't exist matching what is in [CAD FILE] it will
continue to show the image from the previously viewed record.
What can I do to get it to display my default file ("-.jpg") if there is no
file name matching [CAD FILE]? (yes, the file is named "-.jpg"; is this a
problem for any reason?)
This is the code I did this with a bastardization of the code from the
downloaded Picture2K db:
Option Compare Database
Option Explicit
Private Sub cmdClose_Click()
On Error Resume Next
DoCmd.Close
Exit Sub
End Sub
Private Sub Form_AfterUpdate()
On Error Resume Next
Me![Image39].Picture = "\\UNCfilepath\" & [CAD FILE] & ".jpg"
End Sub
Private Sub Form_Current()
On Error Resume Next
Me![Image39].Picture = "\\UNCfilepath\" & [CAD FILE] & ".jpg"
End Sub
Private Sub Image39_Click()
End Sub
I am able to get my form to display a unique linked image for every record.
The image displayed is based on the name of the file stored in a text field -
[CAD FILE].
The problem I am having is that if I am on a record then go to another
record, if a file doesn't exist matching what is in [CAD FILE] it will
continue to show the image from the previously viewed record.
What can I do to get it to display my default file ("-.jpg") if there is no
file name matching [CAD FILE]? (yes, the file is named "-.jpg"; is this a
problem for any reason?)
This is the code I did this with a bastardization of the code from the
downloaded Picture2K db:
Option Compare Database
Option Explicit
Private Sub cmdClose_Click()
On Error Resume Next
DoCmd.Close
Exit Sub
End Sub
Private Sub Form_AfterUpdate()
On Error Resume Next
Me![Image39].Picture = "\\UNCfilepath\" & [CAD FILE] & ".jpg"
End Sub
Private Sub Form_Current()
On Error Resume Next
Me![Image39].Picture = "\\UNCfilepath\" & [CAD FILE] & ".jpg"
End Sub
Private Sub Image39_Click()
End Sub