Report Default

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.
 
M

Mark Hyland

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top