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
| Dim maBD As Database, rstRevenir As Recordset, NewDate, chem As String
Dim TBD As String, rep As Integer, LeDrapeau As Boolean
Set maBD = CurrentDb
Set rstRevenir = maBD.OpenRecordset("Consultation", dbOpenDynaset)
If rstRevenir!DateConsultation <> Date Then
MsgBox "La date système a été changée," & vbLf & _
"Vous devez donc la changer," & vbLf & _
"à l'aide du logiciel prévu.", vbCritical + vbOKOnly, "Défaut date système"
NewDate = Shell("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl")
MsgBox ("") & NewDate
chem = "C:\SVella\VellaTables" & DatePart("yyyy", Date) & ".mdb"
MsgBox ("") & chem
Forms!Acceuil!Texte50 = "Accueil en " & DatePart("yyyy", Date)
'
DétacherToutesLesTables 'on détache les tables déjà attachées
'-------------------------
TBD = "Microsoft Access"
DoCmd.TransferDatabase acLink, TBD, chem, acTable, "Adresses", "Adresses"
End If
' Exit Sub
If rstRevenir!DateConsultation = Date Then
MsgBox "On ne doit pas changer pas la date sytème", vbInformation + vbOKOnly, "Date système"
MsgBox "la date système est le: " & Format(Date, "dd mmmm yyyy")
chem = "C:\SVella\VellaTables" & DatePart("yyyy", Date) & ".mdb"
MsgBox ("") & chem
LeDrapeau = False
Forms!Acceuil!Texte50 = "Accueil en " & DatePart("yyyy", Date)
DétacherToutesLesTables 'on détache les tables déjà attachées |
Partager