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
-
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
4 hours, 16 minutes ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
4 hours, 18 minutes ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
8 hours, 13 minutes ago -
New PC transfer program recommendations?
by
DaveBoston
2 hours, 34 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
12 hours, 18 minutes ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
12 hours, 19 minutes ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
38 minutes ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
6 hours, 35 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
10 hours, 28 minutes ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
1 day, 7 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
5 hours, 12 minutes ago -
System Restore and Updates Paused
by
veteran
1 day, 9 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
20 hours, 54 minutes ago -
Turn off right-click draw
by
Charles Billow
1 day, 13 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
1 day, 16 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
10 hours, 27 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
1 day, 18 hours ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
21 hours, 3 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
2 days ago -
KB5060842 Issue (Minor)
by
AC641
12 hours, 17 minutes ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
2 days, 7 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
23 hours, 54 minutes ago -
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
2 days, 19 hours ago -
June 2025 updates are out
by
Susan Bradley
1 hour, 17 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
3 days, 10 hours ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
2 days, 20 hours ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
3 days, 13 hours ago -
Windows 11 Insider Preview build 26120.4250 (24H2) released to BETA
by
joep517
3 days, 13 hours ago -
Install Office 365 Outlook classic on new Win11 machine
by
WSrcull999
3 days, 13 hours ago -
win 10 to win 11 with cpu/mb replacement
by
aquatarkus
3 days, 5 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.