how to pass a memory variable to a report

G

GrantD

I have a program that calculates sums of samples taken in a period, how do I
transfer the start date and end date which are entered by the user to the
report?
 
L

Larry Linson

GrantD said:
I have a program that calculates sums of
samples taken in a period, how do I
transfer the start date and end date which
are entered by the user to the report?

Assuming they are entered into Text Boxes, or chosen from Combo Boxes on a
Form, leave the Form open and access them using the Forms collection, Form's
name, and name of the Control. Using Public Variables in a Standard Module
is not especially recommended, but works in most environments.

A very useful enhancement to Access 2002/2003 was the addition of the
OpenArgs argument to the DoCmd.OpenReport... pass them as text strings, and
either print them as is, or convert them back to numbers. You can read the
OpenArgs argument in the Open event of the Report, and, though I've never
had occasion to do so, I believe also in any event that occurs after that.

Larry Linson
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