So you are putting these two dates in the report's header section, and you
want to not print the report if the two dates are withing 7 days of each
other?
How are you opening the report? Is the report's recordsource already in use
by a form that may call the report? Likely, there would be no need to
actually open the report, rather just use code to test the condition and
then either open the report if more than 7 days, or display message box if
less than 7 days and not open report.
If you can provide a few more details, we should be able to get you to a
solution.

Signature
Ken Snell
<MS ACCESS MVP>
> hi
> Posted on ActiveX controls page as this has been of the
[quoted text clipped - 26 lines]
> >
> >.
K Crofts - 11 Aug 2004 16:46 GMT
cheers Ken
this is a basic programme, recordsource for form is a
table ('collections'), users will not have access to the
table it will purely be used for storing the information
that users enter/modify via the form. the two dates will
be in the report header so testing teh condition for
opening the report/diplaying an error message sounds
perfect. The report is opened from a command button
('reportcomm'). Hope this is enough information, i really
appreciate your help.
>-----Original Message-----
>So you are putting these two dates in the report's header section, and you
[quoted text clipped - 42 lines]
>
>.
Ken Snell - 11 Aug 2004 19:17 GMT
I'll give you some generic code to start and then you can fill in the gaps.
This code assumes that it's run by clicking a command button (reportcomm) to
open the report:
Private Sub reportcomm_Click()
If DateDiff("d", [PrimaryKeyDate], Date()) > 7 Then
DoCmd.OpenReport "report name"
Else
MsgBox "You cannot open the report at this time."
End If
End Sub

Signature
Ken Snell
<MS ACCESS MVP>
> cheers Ken
> this is a basic programme, recordsource for form is a
[quoted text clipped - 69 lines]
> >
> >.