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 47 48 49 50 51 52 53
| Private Sub macro10()
Dim placard As Integer
Set dbsdepart = CurrentDb
Set rstdepart = dbsdepart.OpenRecordset("TableAutorisationTemporaire", dbOpenDynaset)
placard = rstdepart("armoireAutorisation")
While Not rstdepart.EOF
With rstdepart
placard = rstdepart.Fields("armoireAutorisation").Value
rstdepart.MoveNext
'placard = !armoireAutorisation
End With
Select Case placard
Case Is = 1
SetCursorPos 920, 590
mouse_event MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 920, 590, 0, 0
Me.essai.Value = ""
Case Is = 3
SetCursorPos 720, 590
mouse_event MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 720, 590, 0, 0
Me.essai.Value = ""
Case Is = 4
SetCursorPos 590, 590
mouse_event MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 590, 590, 0, 0
Me.essai.Value = ""
Case Is = 2
SetCursorPos 820, 590
mouse_event MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 820, 590, 0, 0
Me.essai.Value = ""
Case Else
MsgBox "erreur : " & placard
Me.essai.Value = ""
End Select
'rstdepart.MoveNext
Wend
rstdepart.Close
dbsdepart.Close
Set rstdepart = Nothing
End Sub |
Partager