On Error GoTo ErrHandler
Dim filename As Variant
Dim SourceFile, DestinationFile
Dim picturepaht
picturepaht = GetOpenFile_CLT("", "اختر صورة :")
With picturepaht
If picturepaht <> "" Then
Me.imgLogo.Picture = picturepaht
logo = picturepaht
Else
MsgBox "No image selected."
End If
End With
SourceFile = logo
DestinationFile = CurrentProject.Path & "\" & "shar" & ".jpg"
FileCopy SourceFile, DestinationFile
MsgBox "تم تغيير الشعار "
ErrHandler:
If Err.Number = 94 Then
'لابقاء الصورة السابقة إذا لم يتم اختيار صورة
If picturepaht <> "" Then
imgLogo.Picture = CurrentProject.Path & "\" & "shar" & ".jpg"
Else
imgLogo.Picture = ""
Exit Sub
End If
MsgBox "لم يتم تغيير الشعار"
End If
changePic -2.mdb