Macro for Parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Why do it in the macro? You can just do this in the query directly. Put a criteria of
=Date() under whatever date column.
 
Use the Date() function to get the date (or the Now() function to get the
date and time)
 
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()
 
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.
 
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.
 

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

Back
Top