I just came from a meeting with our Marketing department and am not sure I can develop the database that they want. (I am sure I will be asking lots of questions). My question is – they want the ability to create queries on the fly. They gave me 12 fields that they want to be able to fill or not. The first field is a field called Members which has member counts. They want to be able to put in the parameter >100 (for instance). Can you do that? My next question is how would I set up a parameter query with 12 parameters where you can either fill it in or press enter and go on to the next parameter . I am looking for ideas……Thanks for any help you can provide.
![]() |
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 |
-
Parameter Query (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Parameter Query (2000)
- This topic has 18 replies, 7 voices, and was last updated 19 years, 11 months ago.
Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerJuly 26, 2005 at 7:16 pm #962635The way to do this is to create a form with text boxes or combo boxes or a combination in which the user can specify the criteria. When the user clicks the “OK” command button, the WHERE condition is created dynamically. Microsoft has an example in MSKB article ACC2000: How to Filter a Report from a Pop-Up Form; it contains a link to a downloadable sample database. This does not do exactly what you want, but it will hopefully give you some ideas.
Feel free to post more questions as you go along. -
WSlrudge
AskWoody LoungerJuly 26, 2005 at 8:49 pm #962658I have an idea – If I create a form with the 12 fields and use Filter by Form. I know how to put a print command button that will print the results. My question is – is there a way to put the Filter by Form, Apply Filter button and Remove Filter button on the form? I need specifics since I am VBA challenged.
-
WSHansV
AskWoody LoungerJuly 26, 2005 at 9:26 pm #962663You can put a Filter By Form button on a form, as well as an Apply Filter button, by using the control wizard. The wizard doesn’t offer an option for a Remove Filter button, but it’s easy to create one yourself:
– Turn control wizards off.
– Place a command button on the form.
– Name it CmdRemoveFilter.
– Set its caption to Remove Filter.
– Activate the Event tab of the Properties window.
– Click in the On Click box.
– Select [Event Procedure] from the dropdown list.
– Click the … to the right of the dropdown arrow.
– Make the code look like this:Private Sub cmdRemoveFilter_Click()
DoCmd.ShowAllRecords
End Sub– Switch back to Access.
BUT none of these buttons, in particular the Apply Filter one, will work while Filter by Form is on. Access disables all command buttons in Filter by Form mode. The user will have to use the toolbar button or menu option to apply the filter.
-
WSlrudge
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSlrudge
AskWoody LoungerJuly 26, 2005 at 11:52 pm #962715Everything works but the Print button. It prints everything and not just the filtered records. I am using the following code: I am using my home computer so I have Access 2003
Option Compare Database
Dim iFilterType As IntegerPrivate Sub cmdPrint_Click()
Dim frm As Form
Set frm = Forms!frmFilter
If iFilterType = acApplyFilter Then
DoCmd.OpenReport “rptFilter”, acViewPreview, frm.Filter
Else
DoCmd.OpenReport “rptFilter”, acViewPreview
End If
End SubPrivate Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
iFilterType = ApplyType
End SubThanks for your help….
-
WSHansV
AskWoody Lounger -
WSlrudge
AskWoody Lounger -
WSLindaR
AskWoody LoungerJuly 27, 2005 at 10:54 am #962786Another problem. I created the form and when I Filter by Form, in the dropdown list beside each field, I get two choices Null and Not Null. Shouldn’t I get the data that is in the query behind the form? I used a query for the form because I want everything at a Client level. I changed the control source to the table and still get Null and Not Null. Any ideas.
-
WSHansV
AskWoody Lounger -
WSLindaR
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSLindaR
AskWoody LoungerJuly 27, 2005 at 1:42 pm #962842I have been asked to design a system for our Marketing Dept that I think is way over my head. I revealed this at a meeting and my manager is upset. I have done some database design but nothing real involved. They want this in 3 months time. I work in a department responsible for ad hoc reporting. I use Access to run reports and other minor functions. Mostly, I bring in data on a monthly basis and refresh the data. Overwrite a database that is on the network and people have access to it. Am I wrong to feel this is way over my head. I would like to appear confident but I am whelmed………Just would like your opinion on my feelings about this. Is 3 months unrealistic to create a database like this.
-
WSNYIntensity
AskWoody LoungerJuly 27, 2005 at 2:05 pm #962853Linda, have you thought about using a list box? I’m not sure the limitations of a list box, but you can easily create a text box to filter your list box.
You could also use a list box to select your fields for your query (however adding criteria becomes increasingly difficult). I’ll attach an example of how to create a query/add criteria on the fly. (I don’t remember where I pulled this example from).
-
WSHansV
AskWoody LoungerJuly 27, 2005 at 2:07 pm #962854If you can work fulltime on it for three months, you should be able to accomplish a lot. But of course, it depends on the requirements for the database. If they are clear, you should be able to decide whether they are realistic, given the time and your capabilities. If the requirements are still vague, and likely to shift (unfortunately, this is often the case), it can be tricky.
-
WBell
AskWoody_MVPJuly 27, 2005 at 12:27 pm #962812As Hans notes, there are performance concerns when you start loading up dropdown lists with large number of records. However testing I have done suggests that some of the concerns date from 1994 and Access 2 when we were still running the original Pentium chips or even slower. I’ve successfully loaded as large as 60,000 records and gotten surprisingly good results on a Celeron 333 with 64 MB of RAM. Not recommended, but it may be acceptable.
Another idea you might consider: Filter by Form does have it’s limitations as you’ve been discovering. However on a regular form you can apply filters by using the right click menu and applying various kinds of filters. There you can capture the filter properties of the form, then apply them to a report based on the same data source and print the result. User driven requirements are necessary, but they often over-specify the detail level making the developer’s task much more difficult. Another alternative is to create the SQL statement used by the form and report dynamically based on an unbound form – that is more difficult than the Filter by Form approach. Hope this helps.
-
WSrk_winston
AskWoody LoungerJuly 28, 2005 at 2:09 pm #963198Linda, this is something I use to help with those extra large combo boxes with sever thousands of records in the Row Source
I have attached a database that uses a combo box that does not populate until the user enters three characters into the combo box. It will then return any matching records into the RowSource that begin with those three characters. Hopefully when the combo box is selected it will narrow down the list to a couple of hundred instead of 20,000 for you.This is already done in my example but if you create your own…
It works from the On Change event of the combo box.
In the Property window of the combo box make sure the Auto Expand is set to Yes, clear the Control Source, and set the Row Source Type to Table/Query.
Then Change combo_box, your_field and, table_or_query in the following code to correlate with your database.If Len(Me.combo_box.Text) > 2 Then ‘ Checks to see if there is 2 or more characters in the combo box
match = Left(Me.combo_box.Text, 3) ‘ Sets the first 3 characters for the WHERE Clause.
Me.combo_box.RowSource = “SELECT your_field FROM table_or_query ” _
& ” WHERE (((table_or_query.your_field) Like “”” & match & “*””)) ” _
& ” ORDER BY your_field;”
End If
-
-
-
-
-
WSJezza
AskWoody LoungerJuly 26, 2005 at 7:16 pm #962636Hi Linda
This is reasonably easy.
Create a form with the 12 Boxes. Give each a name say txtMember,txtNonMember etc
From the query that runs that form put all the relevant fields in it and use the parameters as follows:
>[Forms]![frmhhh]![txtMember]
>[Forms]![frmhhh]![txtNonMember]
Create a Report from this query.
On the form create acommand button that opens that report. Save
All the officer has to do is say type in 100 in a specific text box and it will find anything over 100
Is that what you are looking for?
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
-
I set up passkeys for my Microsoft account
by
Lance Whitney
35 minutes ago -
AI is for everyone
by
Peter Deegan
4 hours, 53 minutes ago -
Terabyte update 2025
by
Will Fastie
4 hours, 55 minutes ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
5 hours, 15 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
14 hours, 57 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
3 hours, 28 minutes ago -
Plugged in 24-7
by
CWBillow
55 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
1 day, 4 hours ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
1 day, 1 hour ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
2 days, 19 hours ago -
Are Macs immune?
by
Susan Bradley
17 hours, 18 minutes ago -
HP Envy and the Function keys
by
CWBillow
2 days, 2 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
6 hours, 48 minutes ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
3 days, 6 hours ago -
Unable to update to version 22h2
by
04om
15 hours ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
3 days, 14 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
3 days, 14 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
3 days ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
4 days, 3 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
3 days, 16 hours ago -
Is your battery draining?
by
Susan Bradley
15 hours, 38 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
15 hours, 38 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
4 days, 7 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
9 hours, 23 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days, 15 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
3 days, 8 hours ago -
National scam day
by
Susan Bradley
2 days, 14 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
3 days, 11 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
5 days, 8 hours ago -
Tools to support internet discussions
by
Kathy Stevens
3 days, 20 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.