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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Option Compare Database
Public Sub sOuvrir()
'tester si qq'un est déja connecté
If fYaqq1() = True Then
MsgBox "désolé c'est déja pris !", vbCritical + vbOKOnly, "Trop tard ! "
Application.Quit
Else
CurrentDb.Properties("Occupe") = True
End If
End Sub
Public Sub sQuitter()
CurrentDb.Properties("Occupe") = False
Application.Quit
End Sub
Public Function fYaqq1() As Boolean
Dim Prp As Property
On Error GoTo fYaqq1_Error
fYaqq1 = CurrentDb.Properties("Occupe")
fYaqq1_Exit:
Exit Function
fYaqq1_Error:
If Err.Number = 3270 Then
'la propriété n'existe pas encore :
Set Prp = CurrentDb.CreateProperty("Occupe", dbBoolean, False)
CurrentDb.Properties.Append Prp
Set Prp = Nothing
fYaqq1 = CurrentDb.Properties("Occupe")
Else
MsgBox "Erreur inatendue N°" & Err.Number & " (" & Err.Description & ") dans la fonction/procedure fYaqq1 du module DvpPtCom"
End If
GoTo fYaqq1_Exit:
End Function |
Partager