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, 8 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 LoungerViewing 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
-
Convert PowerPoint presentation to Impress
by
RetiredGeek
26 minutes ago -
Debian 12.11 released
by
Alex5723
5 hours, 9 minutes ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
8 hours, 51 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
6 hours, 21 minutes ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
5 hours, 19 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
1 day, 1 hour ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
16 hours, 11 minutes ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 4 hours ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
20 hours, 42 minutes ago -
Some advice for managing my wireless internet gateway
by
LHiggins
4 hours, 15 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
22 hours, 38 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
1 day, 13 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
1 day, 10 hours ago -
Does windows update component store “self heal”?
by
Mike Cross
1 day ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 days, 3 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
11 hours, 50 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
28 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
2 days, 6 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
2 days, 6 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
1 day, 19 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
2 days, 14 hours ago -
0Patch, where to begin
by
cassel23
2 days, 8 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
3 days, 4 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
2 days, 16 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
3 days, 12 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
3 days, 3 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
6 hours, 4 minutes ago -
Installer program can’t read my registry
by
Peobody
2 hours, 15 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
3 days, 1 hour ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
3 days, 9 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.