Printout -prints report and form - I just want report

biskra

Registered User.
Local time
Today, 17:52
Joined
Jan 12, 2004
Messages
35
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
 
i have use it but no solution .
sorry for my bad english.
 
Rich thanx for yur help , the solution was with this code

Private Sub cmdPrint5_Click()
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
If DCount("*", "tbl1", "PrintYesNo=False AND notification=False") > 0 Then
DoCmd.OpenReport "affichage", acViewPreview, , "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


work fine
 

Users who are viewing this thread

Back
Top Bottom