Quick one

peterbowles

Registered User.
Local time
Today, 10:34
Joined
Oct 11, 2002
Messages
163
I have this code

Private Sub Form_Current()

On Error GoTo Err_Form_Current

If IsNull(Photo) Then
Photo = "C:\Documents and Settings\Peter\My Documents\My Pictures\nophoto.bmp"

Else
Me![ImageFrame].Picture = Me![Photo]


End If

Err_Form_Current
MsgBox "This is not a valid File Name", vbOKOnly
Photo = "C:\Documents and Settings\Peter\My Documents\My Pictures\nophoto.bmp"
Me![ImageFrame].Picture = Me![Photo]

End Sub

I cant get the error part of the code to work. It come up with a message

“Compile Error”
“Sub or Function not defined”

Any help would be great
 
Always up for a quick one :D

Err_Form_Current:
MsgBox "This is not a valid File Name", vbOKOnly
Photo = "C:\Documents and Settings\Peter\My Documents\My Pictures\nophoto.bmp"
Me![ImageFrame].Picture = Me![Photo]


You need to put a colon after Err_Form_Current
 

Users who are viewing this thread

Back
Top Bottom