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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data missing on report 1

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi all,

Here is a curly one!
I have on a continous form, data which shows invoice totals etc.
I have a bound check box (PR). On the Afterupdate event I have this code:
If PR Then
Dim strDocName As String
Dim strWhere As String
strDocName = "ReportPDF"
strWhere = "[Invoices]=" & Me!Invoices
DoCmd.OpenReport strDocName, acPreview, , strWhere
Else

End If
End Sub


The purpose is to print that record. The query itself that drives the form has a date selection on the field 'Date Raised" The criteria is this:
Between [forms]![frmselectaccounts]![StartDate] And [forms]![frmselectaccounts]![EndDate]

If I select a date say; 24/3/09 to 24/3/09 the form opens etc and displays the data. If I select a record it will print the invoice report with no problems.

But if I select a date range say; 23/3/09 to 25/3/09, the data willl show ok on the form. If I select any report dated 23/3/09 it will print the report ok, but if I select another date in that range, say 24/3/09 the invoice report will display but with no data!
Inside the query if I look at the data it is all there.
Could some genius give me an answer to this puzzle.

Many thanks.










 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top