i use this code it work fine . my problem is if no data i got my form print as number of rows x2.
CODE
Private Sub cmdPrint5_Click()
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
DoCmd.OpenReport "affichage", acViewPreview, WhereCondition:=" PrintYesNo = False and notification=false "
DoCmd.SetWarnings False
DoCmd.SelectObject acReport, "affichage"
DoCmd.PrintOut acPages, , , , 2
DoCmd.Close acReport, "affichage"
DoCmd.RunSQL "Update tbl1 set PrintYesNo = true where PrintYesNo = false "
DoCmd.SetWarnings True
End If
End Sub
any help please
CODE
Private Sub cmdPrint5_Click()
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
DoCmd.OpenReport "affichage", acViewPreview, WhereCondition:=" PrintYesNo = False and notification=false "
DoCmd.SetWarnings False
DoCmd.SelectObject acReport, "affichage"
DoCmd.PrintOut acPages, , , , 2
DoCmd.Close acReport, "affichage"
DoCmd.RunSQL "Update tbl1 set PrintYesNo = true where PrintYesNo = false "
DoCmd.SetWarnings True
End If
End Sub
any help please