1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Function sauv2()
Dim Msg As String
Dim Rep
Dim DgDef
Dim oFSO As Scripting.FileSystemObject
Dim source As String, destination As String
source = "C:\access\etiqdata.mdb"
destination = "H:\BasesAccess\"
Const BM_OKSEUL = 0
Const BM_OUINONANNULER = 3
Const BM_OUINON = 4
Const BM_OKANNULER = 1
Const BM_STOP = 16
Const BM_INTER = 32
Const BM_INF = 64
Const BM_AVERT = 48
Const IDOUI = 6, IDNON = 7, IDANNUL = 2, IDOK = 1
If Forms![Sauvegarde]![OptionSauvegarde].Value = 3 Then
Msg = "Allumez et branchez le disque dur externe"
DgDef = BM_OKANNULER + BM_INF
Rep = MsgBox(Msg, DgDef, "Etiquettes")
If Rep = IDOK Then
Forms!Sauvegarde!DATESAUV = Now()
Forms!Sauvegarde!HEURESAUV = Now()
oFSO.CopyFile source, destination, True
Else
Exit Function
End If
End If |