Hello -
I'm working on a database for my comics and learning as I go. For each record on my form "Comic Entry" I have an image of the Cover of the comic showing on the form record. This image changes with each record. However, there are some records that I do not have an image for, yet the the record still populates with an image (the last recorded filepath in the table 'Comic info'). I would like there to be no image if I do not have one loaded for a particular record.
All stored data is in one table to include fields: FilePath and FileName. Below is the code I've used (found on another site) in order to have my images populate for each record;
Code:
Option Compare Database
Option Explicit
Private Sub On_Load()
If Me.FilePath > 0 Then
Me.ImageFrame.Visible = True
Else
Me.ImageFrame.Visible = False
End If
End Sub
Private Sub Form_AfterUpdate()
Me.bywho.Visible = Me.Signed
On Error Resume Next
Me![ImageFrame].Picture = Me![FilePath] & Me![FileName]
Me![txtPath] = Me![FilePath] & Me![FileName]
End Sub
Private Sub Form_Current()
Me.bywho.Visible = Me.Signed
On Error Resume Next
Me![ImageFrame].Picture = Me![FilePath] & Me![FileName]
Me![txtPath] = Me![FilePath] & Me![FileName]
End Sub
Private Sub ImageFrame_Click()
End Sub
The If statement is something I started messing around with tonight to see if I could have the ImageForm not visible if the corresponding record's FilePath field was blank. I'm not having any luck there yet. I'm not receiving any errors on it but it's not recognizing what I'm trying to have it do.
I'm using Access 2003 on Windows 7 64-bit.
Thanks in advance for any help.