By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,220 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,220 IT Pros & Developers. It's quick & easy.

query parameters

100+
P: 553
I am setting parameters in Access Query but they wont work.
I run the query, and i get the prompt and in input the required value but the query criteria doesn't change ..

any help?
Aug 9 '07 #1
Share this Question
Share on Google+
6 Replies


JKing
Expert 100+
P: 1,206
Post the SQL for the query.
Aug 9 '07 #2

100+
P: 553
JKing

nothing's wrong with my SQL query. i meant to say the Parameters feature in Access that we use to set up the parameters... once i have set any parameter, that doesn't make any differenc - the criteria remains the same , why's that
Post the SQL for the query.
Aug 9 '07 #3

JKing
Expert 100+
P: 1,206
Ok, I'm still unsure of what your problem is. Right now I'm assuming you have a query and within this query in the WHERE clause you have [Enter Value] or some other type of parameter. This is providing a prompt upon running the query to Enter Value. You enter the value yet the query results remain the same and unfiltered.

Is this accurate? If not I'm going to need you to further explain your problem so I can understand what you're doing and help you get your query functioning properly. Examples are very helpful and maybe some insight into what you are doing.

In either case I still think seeing the SQL would be helpful.
Aug 9 '07 #4

100+
P: 553
If you open any Query in Design View.
Then goto Menu "Query" then click on "Parameters". Now you see Query Parameters window.... If you put in any field and close it. Now execute the Query, you will be prompted to enter a value. Query will run but the value you entered would not make any difference - the critera wouldn't change.. why ?


Ok, I'm still unsure of what your problem is. Right now I'm assuming you have a query and within this query in the WHERE clause you have [Enter Value] or some other type of parameter. This is providing a prompt upon running the query to Enter Value. You enter the value yet the query results remain the same and unfiltered.

Is this accurate? If not I'm going to need you to further explain your problem so I can understand what you're doing and help you get your query functioning properly. Examples are very helpful and maybe some insight into what you are doing.

In either case I still think seeing the SQL would be helpful.
Aug 9 '07 #5

JKing
Expert 100+
P: 1,206
If you open any Query in Design View.
Then goto Menu "Query" then click on "Parameters". Now you see Query Parameters window.... If you put in any field and close it. Now execute the Query, you will be prompted to enter a value. Query will run but the value you entered would not make any difference - the critera wouldn't change.. why ?
Adding a parameter this way basically just adds a variable to your query. If you want it to filter your query results you will need to use it in your WHERE clause. Now had you posted your SQL in the first place I could have told you this several posts ago. You're right there probably isn't anything wrong with your SQL.

It probably looks something like this:
Expand|Select|Wrap|Line Numbers
  1. PARAMETERS myValue Text (255);
  2. SELECT field1, field2, field3
  3. FROM table1;
  4.  
So your query is functioning just as you have told it to. It gets the parameter and runs your select. You need to tell it what to do with that parameter.

Expand|Select|Wrap|Line Numbers
  1. PARAMETERS myValue Text (255);
  2. SELECT field1, field2, field3
  3. FROM table1
  4. WHERE field1 = [myValue];
  5.  
Aug 9 '07 #6

100+
P: 553
Thanks JKing..........

Adding a parameter this way basically just adds a variable to your query. If you want it to filter your query results you will need to use it in your WHERE clause. Now had you posted your SQL in the first place I could have told you this several posts ago. You're right there probably isn't anything wrong with your SQL.

It probably looks something like this:
Expand|Select|Wrap|Line Numbers
  1. PARAMETERS myValue Text (255);
  2. SELECT field1, field2, field3
  3. FROM table1;
  4.  
So your query is functioning just as you have told it to. It gets the parameter and runs your select. You need to tell it what to do with that parameter.

Expand|Select|Wrap|Line Numbers
  1. PARAMETERS myValue Text (255);
  2. SELECT field1, field2, field3
  3. FROM table1
  4. WHERE field1 = [myValue];
  5.  
Aug 13 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.