Private Sub Form_Current()
Dim PhotoPath As String
Dim PhotoPath1 As String
Dim PhotoPath2 As String
Dim PhotoPath3 As String
PhotoPath1 = CurrentProject.Path & "\pic\" & Me![款号] & ".jpg"
PhotoPath2 = CurrentProject.Path & "\pic\" & Me![合同] & ".jpg"
PhotoPath3 = CurrentProject.Path & "\pic\noimg.jpg"
If Dir(PhotoPath1) <> "" And Dir(PhotoPath2) = "" Then
PhotoPath = PhotoPath1
ElseIf Dir(PhotoPath1) = "" And Dir(PhotoPath2) <> "" Then
PhotoPath = PhotoPath2
ElseIf Dir(PhotoPath1) = "" And Dir(PhotoPath2) = "" Then
PhotoPath = PhotoPath3
ElseIf Dir(PhotoPath1) <> "" And Dir(PhotoPath2) <> "" Then
PhotoPath = PhotoPath1
Me.Image1.Picture = PhotoPath
End If
End Sub
不能显示图片请问代码怎么修改?