Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records in Report Preview and Report Print Not The Same 1

Status
Not open for further replies.

JTheisen

Programmer
Joined
Oct 25, 2004
Messages
1
Location
US
The following VB Commands to preview and print a report use the same "Selection" Criteria. The Preview command works fine in regard to only displaying records with a Quantity > 0. However the Print command prints the records with Quantity > 0. Why?

Preview Command (OK)
------------------------------------------------------------
DoCmd.OpenReport stDocName, acPreview, , "OrderID = " & Forms![Orders].OrderID & " AND QUANTITY > 0.0"


Print Command (Not OK)
------------------------------------------------------------
DoCmd.OpenReport stDocName, acNormal, "OrderID = " & Forms![Orders].OrderID & " AND QUANTITY > 0.0
 
One reason for them to differ, is that the second statement (print), lacks a comma (making the filter the "FilterName" arguement in stead of "WhereCondition").

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top