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
| Private Sub Commande412_Click()
On Error GoTo Err_Commande412_Click
Dim stDocName As String
stDocName = "Document_DT"
DoCmd.SetWarnings False
DoCmd.CopyObject , stDocName, acReport, "_Recepisse_Modele"
DoCmd.SetWarnings True
DoCmd.OpenReport stDocName, acViewPreview
If Not IsNull(DLookup("Imprimantes.Numero", "Imprimantes", "Imprimantes.Choix_Imprimante=True")) Then
n_imprimante = Val(DLookup("Imprimantes.Numero", "Imprimantes", "Imprimantes.Choix_Imprimante=True")) - 1
Else
n_imprimante = 0
End If
If n_imprimante <= 0 Then
n_imprimante = 0
End If
Set Reports(stDocName).Printer = Application.Printers(n_imprimante)
DoCmd.OpenReport stDocName, acPreview
Exit_Commande412_Click:
Exit Sub
Err_Commande412_Click:
MsgBox Err.Description
Resume Exit_Commande412_Click |
Partager