Private Sub Form_Open(Cancel As Integer)
Dim TempPath As String
TempPath = CurrentProject.Path & "\" & Forms!产品资料查询窗体.产品资料查询子窗体!产品编号 & ".jpg"
If IsNull(Me.Image0.Picture) Then
MsgBox ("没有该产品图片!")
Else
Me.Image0.Picture = TempPath
End If
End Sub
当产品图片不存在的时候还是会出错..
问题出现在哪里呀??
谢谢。。可以了。。。这是我重新修改的代码!!
Private Sub Form_Open(Cancel As Integer)
Dim TempPath As String
TempPath = CurrentProject.Path & "\" & Forms!产品资料查询窗体.产品资料查询子窗体!产品编号 & ".jpg"
If Dir(TempPath) = "" Then
MsgBox ("没有该产品图片!")
DoCmd.Close
Else
Me.Image0.Picture = TempPath
End If
End Sub