Macro for Parameter

C

chaserracer83

Is there anything I can do in the form of a Marco to automatically type in
todays date in a Parameter Field of a query?

Thank you,
Chase W.
 
J

Joan Wild

Why do it in the macro? You can just do this in the query directly. Put a criteria of
=Date() under whatever date column.
 
D

Douglas J. Steele

Use the Date() function to get the date (or the Now() function to get the
date and time)
 
F

fredg

Is there anything I can do in the form of a Marco to automatically type in
todays date in a Parameter Field of a query?

Thank you,
Chase W.

Well if you want it to automatically be today's date, why do you want
a Parameter?
Just set the criteria on the date field to:
Date()
 
C

chaserracer83

Well I would normally put the Date function directly into the query but this
particular query is used allot in my program to pull up specific dates (IE:
Enter Date for record you are looking for). I would just make another query
for this particular function but my the existing query is used so much in my
program that it has linked queries and all kinds of mess I am affraid to mess
with.

What I was really hoping for is that there would be an easy macro I could
make so that when the screen comes up to enter the date the macro
automatically enters the date for today. I don't even know if there is
anything that can do this? Thank you for your help.
 
F

fredg

Well I would normally put the Date function directly into the query but this
particular query is used allot in my program to pull up specific dates (IE:
Enter Date for record you are looking for). I would just make another query
for this particular function but my the existing query is used so much in my
program that it has linked queries and all kinds of mess I am affraid to mess
with.

What I was really hoping for is that there would be an easy macro I could
make so that when the screen comes up to enter the date the macro
automatically enters the date for today. I don't even know if there is
anything that can do this? Thank you for your help.

You're not being clear.
Do you wish to allow the user a choice to either enter any date or
automatically get the current date?

Set the Criteria of that Date field to:

IIf(IsNull([Enter Date]), Date(),[Enter Date])

If a date is not entered, the query will return the current date.
 
Top