How do I make Access prompt me for a parameter value?

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

Guest

I'm running a query off nested subqueries. I want it to prompt me for a
parameter value...[Current Year], but instead I get an error message "The
Microsoft Jet database engine does not recognize '[Current Year]' as a valid
field name or expression". I know that [Current Year] is not a field but I
want it to prompt the user to enter the parameter value. What do I need to
do?
 
Why not just pull the current year from the system date?

Year(Now())


If you want to promt it, what you posted should work. Where did you put it?
Did you preceed it with an equal sign?


=[Current Year]
 
I'm running a query off nested subqueries. I want it to prompt me for a
parameter value...[Current Year], but instead I get an error message "The
Microsoft Jet database engine does not recognize '[Current Year]' as a valid
field name or expression". I know that [Current Year] is not a field but I
want it to prompt the user to enter the parameter value. What do I need to
do?

It's a good idea to always post the entire query SQL.
It saves time. We don't know what you actually did (compared to what
you say you did).
 
My guess - you need to declare the parameter in your query.

Open the query that is using the [Current Year] and add

Parameters [Current Year] Long;

at the beginning of the query. You are probably trying to do this in a Crosstab
query, which requires parameter declarations.
I'm running a query off nested subqueries. I want it to prompt me for a
parameter value...[Current Year], but instead I get an error message "The
Microsoft Jet database engine does not recognize '[Current Year]' as a valid
field name or expression". I know that [Current Year] is not a field but I
want it to prompt the user to enter the parameter value. What do I need to
do?

It's a good idea to always post the entire query SQL.
It saves time. We don't know what you actually did (compared to what
you say you did).
 
Back
Top