default in code

  • Thread starter Thread starter STEPHEN
  • Start date Start date
S

STEPHEN

I use a form to get a user input on Date Ranges for use
in a report. (i.e. Sales Reports by Date Ranges)

I am calling a form names "Date Ranges for Reports" by
using an OnOpen command for each individual report.

I would like to set the Date range to default to
different values depending upon which Report is being
used.

any help would be greatly appreciated.

Thank you.
 
You can pass a string to the form by using the OpenArgs argument of
DoCmd.OpenForm.
See the Access Help file for details.

HTH
- Turtle
 
Stephen,

I would suggest using the same event that you use to print the
reports, rather than the reports' Open events, to get your Date Ranges
form. I think this would be easier to manage.

As regards the report-specific date ranges, do you mean a "fixed" date
range for the default of each report (in which case you could store
these values in a table and refer to it when the form opens), or do
you mean a "relative" date range, e.g. "last month" (in which case you
might need to use code or a user-defined function to get the defaults
depending on the current date)?

Please post back with some more details, maybe with examples, if you
need more specific help.

- Steve Schapel, Microsoft Access MVP
 
Back
Top