A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I reset a parameter used in a query with applyfilter



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2004, 08:05 PM
PACS
external usenet poster
 
Posts: n/a
Default How do I reset a parameter used in a query with applyfilter

I have a macro that performs a first name search that can be executed from a form. It prompts me for the 'Party First Name to Search For'. It executes the following SQL using applyfilter:

[application number] In (select distinct([application number]) from [application party] where firstname like [Party First Name to Search For]+'*')

It retrieves the correct subset of data.

Then to get back to the whole database I run a macro that does a showallrecords.

It retrieves the complete dataset.

If I try to do the search again I am never prompted and the initial search values are used. How do I get prompted again?

Thanks
--
Paul
  #2  
Old July 8th, 2004, 02:40 AM
Eric Butts [MSFT]
external usenet poster
 
Posts: n/a
Default How do I reset a parameter used in a query with applyfilter

Hi Paul,

ShowAllRecords action removes any applied filter from the active table,
query result set, or form, and display all records in the table or result
set or all records in the form's underlying table or query.

Why not instead just rerun the query and don't supply a value when prompted

like [Party First Name to Search For]+'*'

if you hit enter (do not provide a value when prompted) your query should
return ALL the records.

Then when you need the subset again rerun the query and enter the
appropriate value.

What basically is happening is
Query is run filtering records
ShowAllRecords command removes the filter
Now you would like the filter to come back
What would be needed in the program is for ShowAllRecords to
temporarily store the removed filter somewhere and retrieve it and reapply
it to the Table/Query it removed it from

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or
to visit Windows Update at http://windowsupdate.microsoft.com/ to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights



--------------------
| Thread-Topic: How do I reset a parameter used in a query with applyfilter
| thread-index: AcRkVU31nH9XaAWHSm6erVaimHgClQ==
| X-WBNR-Posting-Host: 66.162.202.193
| From: "=?Utf-8?B?UEFDUw==?="
| Subject: How do I reset a parameter used in a query with applyfilter
| Date: Wed, 7 Jul 2004 12:05:01 -0700
| Lines: 15
| Message-ID:
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.queries
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.queries:206074
| X-Tomcat-NG: microsoft.public.access.queries
|
| I have a macro that performs a first name search that can be executed
from a form. It prompts me for the 'Party First Name to Search For'. It
executes the following SQL using applyfilter:
|
| [application number] In (select distinct([application number]) from
[application party] where firstname like [Party First Name to Search
For]+'*')
|
| It retrieves the correct subset of data.
|
| Then to get back to the whole database I run a macro that does a
showallrecords.
|
| It retrieves the complete dataset.
|
| If I try to do the search again I am never prompted and the initial
search values are used. How do I get prompted again?
|
| Thanks
| --
| Paul
|

  #3  
Old July 8th, 2004, 02:38 PM
PACS
external usenet poster
 
Posts: n/a
Default How do I reset a parameter used in a query with applyfilter

My message may not have been clear. The problem is when I want to perform another search by executing the original firstname search macro I am never prompted and therefore can not enter new search data. The original search is performed without prompting me and returns the original subset of data. I have tried using a remove filter button and the results are the same when I run the macro any time after the first run.

Thanks
--
Paul


"Eric Butts [MSFT]" wrote:

Hi Paul,

ShowAllRecords action removes any applied filter from the active table,
query result set, or form, and display all records in the table or result
set or all records in the form's underlying table or query.

Why not instead just rerun the query and don't supply a value when prompted

like [Party First Name to Search For]+'*'

if you hit enter (do not provide a value when prompted) your query should
return ALL the records.

Then when you need the subset again rerun the query and enter the
appropriate value.

What basically is happening is
Query is run filtering records
ShowAllRecords command removes the filter
Now you would like the filter to come back
What would be needed in the program is for ShowAllRecords to
temporarily store the removed filter somewhere and retrieve it and reapply
it to the Table/Query it removed it from

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or
to visit Windows Update at http://windowsupdate.microsoft.com/ to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights



--------------------
| Thread-Topic: How do I reset a parameter used in a query with applyfilter
| thread-index: AcRkVU31nH9XaAWHSm6erVaimHgClQ==
| X-WBNR-Posting-Host: 66.162.202.193
| From: "=?Utf-8?B?UEFDUw==?="
| Subject: How do I reset a parameter used in a query with applyfilter
| Date: Wed, 7 Jul 2004 12:05:01 -0700
| Lines: 15
| Message-ID:
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.queries
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.queries:206074
| X-Tomcat-NG: microsoft.public.access.queries
|
| I have a macro that performs a first name search that can be executed
from a form. It prompts me for the 'Party First Name to Search For'. It
executes the following SQL using applyfilter:
|
| [application number] In (select distinct([application number]) from
[application party] where firstname like [Party First Name to Search
For]+'*')
|
| It retrieves the correct subset of data.
|
| Then to get back to the whole database I run a macro that does a
showallrecords.
|
| It retrieves the complete dataset.
|
| If I try to do the search again I am never prompted and the initial
search values are used. How do I get prompted again?
|
| Thanks
| --
| Paul
|


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert to a Parameter Query Al Eaton General Discussion 3 July 9th, 2004 04:05 PM
Parameter Query Help mark Running & Setting Up Queries 4 June 2nd, 2004 04:40 PM
Using a query with a replaceable parameter as the source of a control Hoo Using Forms 2 May 30th, 2004 09:43 AM
Using a query with a replaceable parameter as the source of a control Hoo Running & Setting Up Queries 1 May 30th, 2004 07:07 AM
Parameter Query on date using MS Query Brian Links and Linking 0 January 27th, 2004 07:05 AM


All times are GMT +1. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.