تم تعديل الكود كالتالي :
If [BKUP] = True Then
NewFile = [StrNew] & "\" & Format(Date, "dd-mm-yyyy") & " " & Format(Now(), "Hh-Nn AMPM") & "-" & DBwithoutEXT & right(DBwithEXT, 4)
CopyMyDB = "cmd.exe /C copy " & """" & OldFile & """" & " " & """" & NewFile & """"
Shell CopyMyDB, 0
Do Until CheckMyFile(NewFile) = 1
[ResultLBL].Visible = False
Loop
[ResultLBL].Visible = True
If [CloseMe] = True Then DoCmd.Close
Exit Sub
End If
' --------------------- äÓÎ ÇÍÊíÇØí ãÚ ÇáÖÛØ æ ÇáÇÕáÇÍ -------------
Dim NewTempFile As String, NewCompFile As String
If [COMP] = True Then
NewTempFile = [StrNew] & "\" & "MAXXIN" & right(DBwithEXT, 4)
NewCompFile = [StrNew] & "\" & Format(Date, "dd-mm-yyyy") & " " & Format(Now(), "Hh-Nn AMPM") & "-" & DBwithoutEXT & right(DBwithEXT, 4)
CopyMyDB = "cmd.exe /C copy " & """" & OldFile & """" & " " & """" & NewTempFile & """"
Shell CopyMyDB, 0
Do Until CheckMyFile(NewTempFile) = 1
[ResultLBL].Visible = False
Loop
Dim MyPass As String
MyPass = ";" & "PWD" & "=" & [PW]
On Error GoTo Err_Compact
If IsNull([PW]) Then DBEngine.CompactDatabase NewTempFile, NewCompFile
If Not IsNull([PW]) And [PSWRD] = True Then DBEngine.CompactDatabase NewTempFile, NewCompFile, , , MyPass
On Error GoTo 0
[ResultLBL].Visible = True
Kill (NewTempFile)
If [CloseMe] = True Then DoCmd.Close
Exit Sub
End If
MyErr:
If Err.Number <> 0 Then
MsgBox Err.Number & " - " & Err.Description
End If
Err_Compact:
[ResultLBL].Visible = True
[ResultLBL].Caption = "áã" & vbCr & "íäÌÍ" & vbCr & "ÇáÇÌÑÇÁ"
Kill (NewTempFile)
MsgBox Err.Number & " - " & Err.Description, , "áã ÊäÌÍ ÇáÚãáíÉ"
End Sub
ولكن عن عمل نسخة احتياطية مع الضغط يعطى خطأ عن
Kill (NewTempFile)
فلا أدري كيف يمكن التعديل عليها هذه النقطة