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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
| Option Compare Database
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub Commande37_Enter()
End Sub
Sub Form_Current()
On Error GoTo Form_Current_Err
If ChildFormIsOpen() Then FilterChildForm
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub
Sub LienBascule_Click()
On Error GoTo LienBascule_Click_Err
If ChildFormIsOpen() Then
CloseChildForm
Else
OpenChildForm
FilterChildForm
End If
LienBascule_Click_Exit:
Exit Sub
LienBascule_Click_Err:
MsgBox Error$
Resume LienBascule_Click_Exit
End Sub
Private Sub FilterChildForm()
If Me.NewRecord Then
Forms![FCommande].DataEntry = True
Else
Forms![FCommande].Filter = "[IDEntreprise] = " & Me![IDEntreprise]
Forms![FCommande].FilterOn = True
End If
End Sub
Private Sub OpenChildForm()
DoCmd.OpenForm "FCommande"
If Not Me![LienBascule] Then Me![LienBascule] = True
End Sub
Private Sub CloseChildForm()
DoCmd.Close acForm, "FCommande"
If Me![LienBascule] Then Me![LienBascule] = False
End Sub
Private Function ChildFormIsOpen()
ChildFormIsOpen = (SysCmd(acSysCmdGetObjectState, acForm, "FCommande") And acObjStateOpen) <> False
End Function
Private Sub Recherche_Click()
On Error GoTo Err_Recherche_Click
Me.RaisonSociale.SetFocus
DoCmd.RunCommand acCmdFind
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Recherche_Click:
Exit Sub
Err_Recherche_Click:
MsgBox Err.Description
Resume Exit_Recherche_Click
End Sub
Private Sub Créer_nouvelle_fiche_client_Click()
On Error GoTo Err_Créer_nouvelle_fiche_client_Click
DoCmd.GoToRecord , , acNewRec
Exit_Créer_nouvelle_fiche_client_Click:
Exit Sub
Err_Créer_nouvelle_fiche_client_Click:
MsgBox Err.Description
Resume Exit_Créer_nouvelle_fiche_client_Click
End Sub
Private Sub Commande48_Click()
On Error GoTo Err_Commande48_Click
DoCmd.GoToRecord , , acNewRec
Exit_Commande48_Click:
Exit Sub
Err_Commande48_Click:
MsgBox Err.Description
Resume Exit_Commande48_Click
End Sub |
Partager