Parameter Query Default Value

G

Goofy

I have a query which prompts the user to enter the year and week number.
However, I do need to give them default parameters ( IF POSSIBLE ) is there
a way around this without using a form ?


Cheers
 
D

Douglas J. Steele

Hate to argue, Roger, but depending on what Goofy means by default
parameters, it is possible.

For example, if he's currently got a parameter [What Year?] that pops up, he
can replace [What Year?] in his query with IIf([What Year?], Year(Date()),
[What Year?]). If the user hits Enter, rather than providing a year, it will
automatically assume the current year. Of course, it's critical that both
references to [What Year?] in the IIf statement be typed identically. It may
also be helpful to put a message about the default, such as:

IIf([What Year?(Just hit enter for this year)], Year(Date()), [What
Year?(Just hit enter for this year)])

(I don't think it's possible to dynamically change the prompt so that it
fills in the value of Year(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

Top