473,480 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filtering a query or report from user text input

1 New Member
Hi!

In one of my tables I have an attribute called "descripton", which is a description of a particular item.

One example is
"Colonial cedar bookcase".

Is there anyway I can use user input to filter a query (or preferably a report using the "where" function in macros)? I want the user to be able to input "cedar" and have all records containing "cedar" in the descripton field appear.
Mar 11 '07 #1
2 2631
ADezii
8,834 Recognized Expert Expert
Hi!

In one of my tables I have an attribute called "descripton", which is a description of a particular item.

One example is
"Colonial cedar bookcase".

Is there anyway I can use user input to filter a query (or preferably a report using the "where" function in macros)? I want the user to be able to input "cedar" and have all records containing "cedar" in the descripton field appear.
__1. You cannot open a Query within a Macro and specify a WHERE Clause.
__2. You can open a Report within a Macro and specify a WHERE Clause in the following manner: [fieldname] = Forms![formname]![controlname on form]
__3. Why not create a Parameter Query and have the User set the criteria within the Query. e.g. in the Criteria cell of Description [Enter Description]. You can now run the Query from a Macro. You can also set the Record Source of a Report to this Query then open the Report from a Macro bypassing the WHERE Clause.
Mar 11 '07 #2
NeoPa
32,556 Recognized Expert Moderator MVP
Hi!

In one of my tables I have an attribute called "descripton", which is a description of a particular item.

One example is
"Colonial cedar bookcase".

Is there anyway I can use user input to filter a query (or preferably a report using the "where" function in macros)? I want the user to be able to input "cedar" and have all records containing "cedar" in the descripton field appear.
When opening your form or report from your VBA code, simply specify a 'WhereCondition' argument :
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport("rptName",,,"[FieldName] Like '*cedar*'")
Mar 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
23425
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor...
9
4508
by: MadingS | last post by:
Is there an HTML (or CSS) way to say "use the user's INPUT font, whatever that might be."? Most browsers have the ability for the user to pick his or her own preference for what font to use...
3
5826
by: sfjnet | last post by:
Hi I am relatively new to Access so I hope I am not embarrassing myself with this question. I have created a database showing contract details (contract number, contractors, dates, other...
18
2490
by: mlcampeau | last post by:
I have a lengthy query that I am now trying to filter. The query calculates an employee's Anniversary Date in which they are eligible for the next level of Annual Vacation. (i.e. For 1-6 years of...
6
1421
by: pukhton | last post by:
Hello~ Just a quick question about Access Reports. I want to have a form for user where they will have two textbox and one combo box to pick from and run the query based on that. 1 txtbox is...
1
1284
by: Gilberto | last post by:
Hello, I have two tables: COSTING and PRICING, both with the following fields: product name French packaging transportation ddp I want to create a query so that from a text box in the...
0
1802
by: pazazuzu | last post by:
Hi everyone, I currently have an assignment which I am almost done with but am having problems trying to figure out how to integrate a string function search. I have a text box called...
3
1696
by: Michael McElyea | last post by:
I would like a query that will search for all column entries that contain a user's input. For instance I have 1 column that contains numbers such as 6149.2243 and 6149.8965. The user will search...
2
3790
sueb
by: sueb | last post by:
I have a crosstab query that gathers all records for a fiscal year specified by the user's input, then counts the number of records that fall within a specific month, grouped by a discriminant in...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.