default in code

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

MacDermott

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
 
S

Steve Schapel

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
 

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