My clients pay me fees by standing order into several different bank accounts. When the bank statement arrives I have to check that the clients I expected to pay this month have in fact paid. The form I use is based on a parameter query so that I can enter the code for the bank account I want to deal with & I
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Selecting from the results of a Parameter Query (2003)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Selecting from the results of a Parameter Query (2003)
- This topic has 42 replies, 4 voices, and was last updated 20 years, 9 months ago.
AuthorTopicIanDarkwater
AskWoody LoungerSeptember 9, 2004 at 12:54 pm #409697Viewing 1 reply threadAuthorReplies-
WSFrancois
AskWoody Lounger -
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 2:11 pm #875211I think I have not explained myself well enough! There I am sitting looking at client records presented as a continuous form selected by a parameter query with a user input of bank account. Then I decide I only want to look at the clients thus selected but with surnames starting with say ‘P’ by clicking on a command button. It’s particularly important that its quick & simple to jump back & forth WITHIN the original selection.
So I constructed a filter which I hoped would act on the current selection and further refine it to select only clients with surnames starting with ‘P’ but without having to requery the original parameter query & reselect the bank account.. This I cannot do. Any thoughts?
-
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 3:03 pm #875226 -
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 3:40 pm #875254Francois
Excellent implementation! Almost perfect but because the base query is a parameter query when you click a letter it requeries the underlying parameter query & reprompts for the parameter. The very thing I’m trying to avoid! I want to say that once I’ve entered the parameter on form open thereafter select alphabetically within the parameter selection & don’t requery.Any further thoughts?
TIA
Ian
-
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 3:40 pm #875255Francois
Excellent implementation! Almost perfect but because the base query is a parameter query when you click a letter it requeries the underlying parameter query & reprompts for the parameter. The very thing I’m trying to avoid! I want to say that once I’ve entered the parameter on form open thereafter select alphabetically within the parameter selection & don’t requery.Any further thoughts?
TIA
Ian
-
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 3:52 pm #875266You could change the filtering code to do a find first on the recordsetclone. Have a test and see if that works.
Private Sub Frame14_AfterUpdate() Dim strcriteria As String strcriteria = "Naam Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) Me.RecordsetClone.FindFirst strcriteria Me.Bookmark = Me.RecordsetClone.Bookmark End Sub
-
IanDarkwater
AskWoody Lounger -
WSMarkD
AskWoody LoungerSeptember 9, 2004 at 4:22 pm #875283I would do this by applying filter to form. Example – simple continuous form based on Northwind Orders table, where the EmployeeID is query parameter, and CustomerID is the field to be filtered by letter entered by user:
Private Sub cmdFilter_Click()
On Error GoTo Err_Handler
Dim sFilter As String
Dim sChar As String
' Optionally leave blank to see all records (but still filtered by EmployeeID)
sFilter = vbNullString
sChar = InputBox$("Enter Letter to filter Customer ID " & _
"(leave blank for all):", "FILTER")
If Len(sChar) > 0 Then
' Must be valid character (letter):
If Asc(UCase$(sChar)) >= 65 And Asc(UCase$(sChar)) <= 90 Then
' Form already filtered by EmployeeID when opened:
sFilter = "[EmployeeID]= " & Me.EmployeeID & " AND " & _
"[CustomerID] Like " & Chr$(39) & Left$(sChar, 1) & "*" & Chr$(39)
Else
MsgBox "Invalid filter character entered.", vbExclamation, "INVALID FILTER"
End If
Else
' No character entered, display all records with EmployeeID filter only:
sFilter = "[EmployeeID]= " & Me.EmployeeID
End If
If Len(sFilter) > 0 Then
' Form FilterOn should already be true...
Me.FilterOn = True
Me.Filter = sFilter
Else
' nothing happens
End If
Exit_cmdFilter_Click:
Exit Sub
Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbExclamation, "ERROR"
Resume Exit_cmdFilter_Click
End Sub
This example uses inputbox to get filter criteria, could also use textbox, buttons, or other methods. Applying form filter did NOT cause a requery (and therefore did not invoke the parameter dialog). I wouldn’t even use the parameter query, I’d use a combo or something to apply the primary filter (the one used for parameter) & open form filtered by selected criteria.
HTH
-
WSMarkD
AskWoody LoungerSeptember 9, 2004 at 4:22 pm #875284I would do this by applying filter to form. Example – simple continuous form based on Northwind Orders table, where the EmployeeID is query parameter, and CustomerID is the field to be filtered by letter entered by user:
Private Sub cmdFilter_Click()
On Error GoTo Err_Handler
Dim sFilter As String
Dim sChar As String
' Optionally leave blank to see all records (but still filtered by EmployeeID)
sFilter = vbNullString
sChar = InputBox$("Enter Letter to filter Customer ID " & _
"(leave blank for all):", "FILTER")
If Len(sChar) > 0 Then
' Must be valid character (letter):
If Asc(UCase$(sChar)) >= 65 And Asc(UCase$(sChar)) <= 90 Then
' Form already filtered by EmployeeID when opened:
sFilter = "[EmployeeID]= " & Me.EmployeeID & " AND " & _
"[CustomerID] Like " & Chr$(39) & Left$(sChar, 1) & "*" & Chr$(39)
Else
MsgBox "Invalid filter character entered.", vbExclamation, "INVALID FILTER"
End If
Else
' No character entered, display all records with EmployeeID filter only:
sFilter = "[EmployeeID]= " & Me.EmployeeID
End If
If Len(sFilter) > 0 Then
' Form FilterOn should already be true...
Me.FilterOn = True
Me.Filter = sFilter
Else
' nothing happens
End If
Exit_cmdFilter_Click:
Exit Sub
Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbExclamation, "ERROR"
Resume Exit_cmdFilter_Click
End Sub
This example uses inputbox to get filter criteria, could also use textbox, buttons, or other methods. Applying form filter did NOT cause a requery (and therefore did not invoke the parameter dialog). I wouldn’t even use the parameter query, I’d use a combo or something to apply the primary filter (the one used for parameter) & open form filtered by selected criteria.
HTH
-
WSFrancois
AskWoody Lounger -
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 6:24 pm #875341Combining Francois’s ideas & interface which I like with Marks suggestion I tried to mod Francois’s code to : –
Private Sub Frame14_AfterUpdate()
Dim strcriteria As String
strcriteria = “[OurBank]= ” & Me.OurBank & ” AND ” & _
“Surname Like ” & Chr(34) & Chr(64 + Me.Frame14) & “*” & Chr(34)Me.Filter = strcriteria
Me.FilterOn = True
End SubBut it didn’t do what I expected! The parameter query was still requeried. Can anyone help to suggest why & how to tweak it?
TIA
-
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 6:41 pm #875364(Edited by Francois on 09-Sep-04 21:41. edit to correct pre tags)
If you have already a filter you could use :
Private Sub Frame14_AfterUpdate() Dim strcriteria As String If Me.Filter = "" Then strcriteria = Me.Filter & " AND Surname Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) Else strcriteria = "Surname Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) End If Me.Filter = strcriteria Me.FilterOn = True End Sub
Where is Me.OurBank coming from ? from the record source or from an unbound textbox in the form header or footer ?
-
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 6:54 pm #875377 -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody Lounger -
WSFrancois
AskWoody Lounger -
WSFrancois
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 8:06 pm #875437Sorry for having waste your time with the stripping of the db.
I have a workaround.
I build a form frmParameter with one textbox asking the parameter and a button to open the form.
In the query I set a criteria to >[forms]![frmparameter]![text0]
With this system the parameter is not asked every time you select an alpha character.
Do you think you can modify your db with this workaround ?
In attachment a sample db, just open the form frmParameter -
IanDarkwater
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 8:06 pm #875438Sorry for having waste your time with the stripping of the db.
I have a workaround.
I build a form frmParameter with one textbox asking the parameter and a button to open the form.
In the query I set a criteria to >[forms]![frmparameter]![text0]
With this system the parameter is not asked every time you select an alpha character.
Do you think you can modify your db with this workaround ?
In attachment a sample db, just open the form frmParameter -
WScharlotte
AskWoody LoungerSeptember 10, 2004 at 1:37 am #875550Must you actually filter the form, or would a means of navigating to the first item in the “Ps”, for instance” be enough? I’m attaching a sample that allows you to do that. It was built in 2002 and is in 2000 format, but it should run in 2003 if you replace the reference to the Access 10.0 object library.
-
IanDarkwater
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WScharlotte
AskWoody LoungerSeptember 10, 2004 at 1:37 am #875551Must you actually filter the form, or would a means of navigating to the first item in the “Ps”, for instance” be enough? I’m attaching a sample that allows you to do that. It was built in 2002 and is in 2000 format, but it should run in 2003 if you replace the reference to the Access 10.0 object library.
-
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 6:54 pm #875378 -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 6:41 pm #875365(Edited by Francois on 09-Sep-04 21:41. edit to correct pre tags)
If you have already a filter you could use :
Private Sub Frame14_AfterUpdate() Dim strcriteria As String If Me.Filter = "" Then strcriteria = Me.Filter & " AND Surname Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) Else strcriteria = "Surname Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) End If Me.Filter = strcriteria Me.FilterOn = True End Sub
Where is Me.OurBank coming from ? from the record source or from an unbound textbox in the form header or footer ?
-
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 6:24 pm #875342Combining Francois’s ideas & interface which I like with Marks suggestion I tried to mod Francois’s code to : –
Private Sub Frame14_AfterUpdate()
Dim strcriteria As String
strcriteria = “[OurBank]= ” & Me.OurBank & ” AND ” & _
“Surname Like ” & Chr(34) & Chr(64 + Me.Frame14) & “*” & Chr(34)Me.Filter = strcriteria
Me.FilterOn = True
End SubBut it didn’t do what I expected! The parameter query was still requeried. Can anyone help to suggest why & how to tweak it?
TIA
-
IanDarkwater
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody Lounger -
IanDarkwater
AskWoody Lounger -
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 3:52 pm #875267You could change the filtering code to do a find first on the recordsetclone. Have a test and see if that works.
Private Sub Frame14_AfterUpdate() Dim strcriteria As String strcriteria = "Naam Like " & Chr(34) & Chr(64 + Me.Frame14) & "*" & Chr(34) Me.RecordsetClone.FindFirst strcriteria Me.Bookmark = Me.RecordsetClone.Bookmark End Sub
-
-
-
WSFrancois
AskWoody LoungerSeptember 9, 2004 at 3:03 pm #875227
-
-
IanDarkwater
AskWoody LoungerSeptember 9, 2004 at 2:11 pm #875212I think I have not explained myself well enough! There I am sitting looking at client records presented as a continuous form selected by a parameter query with a user input of bank account. Then I decide I only want to look at the clients thus selected but with surnames starting with say ‘P’ by clicking on a command button. It’s particularly important that its quick & simple to jump back & forth WITHIN the original selection.
So I constructed a filter which I hoped would act on the current selection and further refine it to select only clients with surnames starting with ‘P’ but without having to requery the original parameter query & reselect the bank account.. This I cannot do. Any thoughts?
-
-
WSFrancois
AskWoody Lounger
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
4 hours, 8 minutes ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
3 hours, 59 minutes ago -
Set default size for pasted photo to word
by
Cyn
10 hours, 1 minute ago -
Dedoimedo tries 24H2…
by
Cybertooth
5 hours, 3 minutes ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
1 day, 8 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
1 day, 6 hours ago -
Small desktops
by
Susan Bradley
1 hour, 31 minutes ago -
Totally disable Bitlocker
by
CWBillow
2 hours, 32 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
1 day, 6 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
2 days, 12 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
7 hours, 41 minutes ago -
Mystical Desktop
by
CWBillow
2 days, 16 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
1 day, 21 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
13 hours, 29 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
3 days, 7 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
3 days, 10 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
3 days, 8 hours ago -
What is wrong with simple approach?
by
WSSpoke36
1 day, 6 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
3 days, 19 hours ago -
Location, location, location
by
Susan Bradley
2 days, 10 hours ago -
Cannot get a task to run a restore point
by
CWBillow
3 days, 21 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
3 days, 11 hours ago -
June 2025 Office non-Security Updates
by
PKCano
4 days, 7 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
3 hours, 31 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
4 days, 7 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
4 days, 18 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
3 days, 20 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
5 days, 2 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
5 days, 3 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
4 days, 16 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.