السلام عليكم
تفضل التعديل أخي الكريم
و هذا هو الكود المستخدم:
On Error Resume Next
Dim strpath As String
Dim PathImg As String
strpath = CurrentProject.Path & "\Scans\StPic"
If Len(Dir(strpath, vbDirectory)) = 0 Then
MkDir (strpath)
End If
Dim fpath As Variant
With Application.FileDialog(3)
.Title = "اختر صورة الشخص"
.Filters.Clear
.Filters.Add "صورة", "*.jpg"
.AllowMultiSelect = False
.InitialFileName = ""
If .Show = -1 Then
PathImg = .SelectedItems(1)
End If
End With
FileCopy PathImg, strpath & "\Pic" & Me.txt_StID & ".jpg"
Me.St_Pic = strpath & "\Pic" & Me.txt_StID & ".jpg"
Desktop.rar