Group:  Microsoft Access ยป microsoft.public.access.queries
Thread: Parameter Query that does not prompt

Parameter Query that does not prompt
bnhcomputing <bnhcomputing[ at ]yahoo.com> 12/30/2008 10:18:52 PM
I have created a simple parameter query. What I would like to do is:

SELECT * FROM QUERY1(param1=2008) and get back the data for year
2008.
SELECT * FROM QUERY1(param1=2007) and get back the data for year
2007.

The problem is, it ASKS for the year, is there a way to actually pass
in the year whithout making a form?

Thanks in advance
Re: Parameter Query that does not prompt
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 12/31/2008 1:28:40 AM
The alternative to creating a form is to dynamically generate the SQL string
instead of asking for a parameter, e.g.:
iYear = 2008
strSql = "SELECT Query1.* FROM Query1 WHERE TheYear = " & iYear

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"bnhcomputing" <bnhcomputing[ at ]yahoo.com> wrote in message
news:078a8939-3cdc-4299-ba87-cdb32547dcc6[ at ]r13g2000vbp.googlegroups.com...
[Quoted Text]
>I have created a simple parameter query. What I would like to do is:
>
> SELECT * FROM QUERY1(param1=2008) and get back the data for year
> 2008.
> SELECT * FROM QUERY1(param1=2007) and get back the data for year
> 2007.
>
> The problem is, it ASKS for the year, is there a way to actually pass
> in the year whithout making a form?
>
> Thanks in advance

Home | Search | Terms | Imprint
Newsgroups Reader