السلام عليكم ورحمة الله
الاخوة الكرام خبراء المنتدى عندي كود حفظ نسخة ملف اكسيس شغال 100/100 يحفظ في documents واري ان يحفظ في مجلد باسم MyBk cبداخل documents
جزاكم الله خيرا
Option Compare Database
Option Explicit
Private Sub Command1_Click()
crBkp
End Sub
Private Sub HxtyalALMaster_Click()
Dim title
With Application.FileDialog(msoFileDialogFolderPicker)
title = "Please select tha MakanTexzin folder"
.ButtonName = CurrentProject.Path
If .Show = True Then
Me.MakanTexzin.Value = .SelectedItems(1)
End If
End With
End Sub
Public Function crBkp() As Boolean
Dim source As String
Dim target As String
Dim a As Integer
Dim objFSO As Object
Dim Path As String
If MsgBox("åá ÊÑíÏ ÍÝÙ äÓÎÉ áÈÑäÇãÌß¿", vbExclamation + vbYesNo) = vbYes Then
Path = CurrentProject.Path & "\"
Dim nm: nm = CurrentProject.name
source = CurrentDb.name
target = target & nm & Format(Now(), "dd-mm-yyyy h m s") & ".accdb"
a = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
a = objFSO.CopyFile(source, target, True)
Set objFSO = Nothing
MsgBox "Êã ÇáÍÝÙ ÈäÌÇÍ", vbInformation
Else
MsgBox "áã íÊã ÇáäÓÎ ", vbInformation
End If
End Function