S
SusanJane sjl
I was able to do the code to get my pictures to show up on a form, but I get
an error message if there is no picture availabe. How can I avoid this?
Here's the code:
Option Explicit
Dim filename As String, pathname As String
Dim db As DAO.Database
Private Sub Form_Activate()
'find the path of the current database
'which is where the jpegs are stored
Set db = CurrentDb
filename = db.Name
pathname = Mid(filename, 1, Len(filename) - Len(Dir(filename)))
End Sub
Private Sub Form_Current()
'set the picture path
Me.Image6.Picture = pathname & Me.ImagePath
Exit_cmdClose_Click:
End Sub
Private Sub close_Click()
On Error GoTo Err_close_Click
DoCmd.close
Exit_close_Click:
Exit Sub
Err_close_Click:
MsgBox Err.Description
Resume Exit_close_Click
End Sub--
Always grateful for help!!
an error message if there is no picture availabe. How can I avoid this?
Here's the code:
Option Explicit
Dim filename As String, pathname As String
Dim db As DAO.Database
Private Sub Form_Activate()
'find the path of the current database
'which is where the jpegs are stored
Set db = CurrentDb
filename = db.Name
pathname = Mid(filename, 1, Len(filename) - Len(Dir(filename)))
End Sub
Private Sub Form_Current()
'set the picture path
Me.Image6.Picture = pathname & Me.ImagePath
Exit_cmdClose_Click:
End Sub
Private Sub close_Click()
On Error GoTo Err_close_Click
DoCmd.close
Exit_close_Click:
Exit Sub
Err_close_Click:
MsgBox Err.Description
Resume Exit_close_Click
End Sub--
Always grateful for help!!