Private Sub Form_Current()Dim PhotoPath As String
Dim PhotoPath2 As String
PhotoPath = CurrentProject.Path & "\主图\" & Me![产品编号] & ".jpg"
PhotoPath2 = CurrentProject.Path & "\副图\" & Me![产品编号] & ".jpg"
If Dir(PhotoPath) = "" Then
PhotoPath = CurrentProject.Path & "\副图\" & Me![产品编号] & ".jpg"
ElseIf Dir(PhotoPath2) = "" Then
PhotoPath = CurrentProject.Path & "\2.jpg"
Else
End If
Me.pic.Picture = PhotoPath
End Sub
不知道哪错了,还是只能在两个文件夹里找图片