Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-31-2007, 05:43 AM
pthoopth pthoopth is offline
Registered User
 
Join Date: Aug 2007
Posts: 3
pthoopth is on a distinguished road
Exclamation Clearing Parameter in Query

I have a query parameter that I'm running from a form and it works fine the first time. Pops up and asks me for the parameter with no problem and the query runs fine. However, if I run the same query again it doesn't ask me for the parameter - it just takes whatever I entered the first time. How do I clear this so it always asks me for the parameter?
Reply With Quote
Sponsored Links
  #2  
Old 08-31-2007, 06:21 AM
neileg's Avatar
neileg neileg is offline
AWF VIP
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,971
neileg has a spectacular aura aboutneileg has a spectacular aura about
Are you capturing the parameter in a control on the form?
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil
Reply With Quote
  #3  
Old 08-31-2007, 06:27 AM
pthoopth pthoopth is offline
Registered User
 
Join Date: Aug 2007
Posts: 3
pthoopth is on a distinguished road
No - I'm just using the parameter built in dialog. I works fine if I close the form and then reopen it but obviously I don't really want to do that.
Reply With Quote
  #4  
Old 08-31-2007, 06:59 AM
neileg's Avatar
neileg neileg is offline
AWF VIP
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,971
neileg has a spectacular aura aboutneileg has a spectacular aura about
Well then, do capture it in the form.
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil
Reply With Quote
  #5  
Old 08-31-2007, 07:40 AM
pthoopth pthoopth is offline
Registered User
 
Join Date: Aug 2007
Posts: 3
pthoopth is on a distinguished road
Thanks - but I don't want to capture it in a form. I just want to rerun the query like it runs the first time - with the built in popup.
Reply With Quote
  #6  
Old 09-03-2007, 06:23 AM
neileg's Avatar
neileg neileg is offline
AWF VIP
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,971
neileg has a spectacular aura aboutneileg has a spectacular aura about
Ok, having thought about this, I supect that what is happening is:

1) you have a comand button on your form that runs the query
2) When you click on this, it runs the query and the parameter dialogue box appears
3) You complete the parameter, the query runs
4) You return to the form
5) You click the query button again, but because the query is still open in the background, it simply switches the view back to the query
6) You then think the query has re-run with the old parameter, but it hasn't, it's the same query result

If you had closed the query after step 3) the parameter box would appear ready for the new parameter. There must be something in the code in the form that closes the query, so that closing and re-opening the form makes it work.
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil

Last edited by neileg; 09-03-2007 at 06:35 AM..
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieving parameter query records Penmore Modules & VBA 0 11-23-2006 11:24 PM
Adding a Auto increment Text/Number elliotth123 Tables 12 09-13-2006 05:18 AM
Parameter Query uplink600 Forms 1 03-16-2005 12:00 PM
parameter crosstab query in VBA huebner Modules & VBA 5 01-31-2005 07:24 AM
Report & Update Query Based on Parameter Carmen Queries 3 01-07-2002 06:39 AM


All times are GMT -8. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World