Report Default

  • Thread starter Thread starter K Crofts
  • Start date Start date
K

K Crofts

Hi
I have a command button on my form that will print a
report. the report shows teh relevand date and todays
date. Is there any way to set up the button so that if the
dates are within 7 days of each other on the report a
message box with an error message is displayed?
Any help appreciated.
 
Hi,

You could write some code which compares the two dates. Is the report
filtered by Date, is this date shown on a form, or is the report based on a
query. If so, then you could refer to that date, and then compare todays
date with that date using the DateDiff Function.

If the result is <=7 days then you could show a message box, and not open
the report. You could also place the code in the report, and call it on one
of the reports events, to compare them.

I hope this is of some help.

Regards

Mark

This information is provided "as is" and expresses no warranties or confers
no rights.
 
Back
Top