techkenny1
Technical User
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.
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.