macro date entry

S

Steve Y

I have a series of reports that are based on entering some date parameters.
They are for each employee. I know how to set up a macro to run them all,
but how can I set it up so that it asks for the beginning and ending date at
the very beginning and then applies this parameter to all the reports? Each
of these reports is based on a query. I really need to know ASAP on this one.
 
J

John W. Vinson

I have a series of reports that are based on entering some date parameters.
They are for each employee. I know how to set up a macro to run them all,
but how can I set it up so that it asks for the beginning and ending date at
the very beginning and then applies this parameter to all the reports? Each
of these reports is based on a query. I really need to know ASAP on this one.

The simplest way is to create a little unbound form frmCrit with two
textboxes, txtFrom and txtTo; for your criteria use
= [Forms]![frmCrit]![txtFrom] AND <= [Forms]![frmCrit]![txtTo]

Put a command button on frmCrit to run your macro.

John W. Vinson [MVP]
 
S

Steve Y

GREAT! That worked well. Now one more question if possible. I have this
Macro set up to "print". Is there anyway to send it to a "specific" printer?
Ultimately I would like to send it to Adobe to immediately create a .PDF
file.

John W. Vinson said:
I have a series of reports that are based on entering some date parameters.
They are for each employee. I know how to set up a macro to run them all,
but how can I set it up so that it asks for the beginning and ending date at
the very beginning and then applies this parameter to all the reports? Each
of these reports is based on a query. I really need to know ASAP on this one.

The simplest way is to create a little unbound form frmCrit with two
textboxes, txtFrom and txtTo; for your criteria use
= [Forms]![frmCrit]![txtFrom] AND <= [Forms]![frmCrit]![txtTo]

Put a command button on frmCrit to run your macro.

John W. Vinson [MVP]
 
J

John W. Vinson

GREAT! That worked well. Now one more question if possible. I have this
Macro set up to "print". Is there anyway to send it to a "specific" printer?
Ultimately I would like to send it to Adobe to immediately create a .PDF
file.

Take a look at the online help for PrintOut. I don't use macros (I find VBA
code more flexible and actually often easier to use) so I'm not sure of the
details.

John W. Vinson [MVP]
 
Top