473,698 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Pull All as well as specific data

3 New Member
I have a query that is supposed to pull data from the table based on the unit that is selected from a combo box on a form. I have the query pulling a specific unit but I want the user to be able to pull all units if they select "ALL" from the combo box. How do I do this?
For example:
Units can be 1w, 2w, 3w or All.
The user selects 1w on the form and the query pulls all data for the unit 1w. When the user selects All, instead of pulling all data for all units it pull nothing.

The criteria in the query is
Criteria: [Forms].[ProgramFS]![cboUnit]
Oct 2 '07 #1
3 2082
Luke Bailey
21 New Member
I have a query that is supposed to pull data from the table based on the unit that is selected from a combo box on a form. I have the query pulling a specific unit but I want the user to be able to pull all units if they select "ALL" from the combo box. How do I do this?
For example:
Units can be 1w, 2w, 3w or All.
The user selects 1w on the form and the query pulls all data for the unit 1w. When the user selects All, instead of pulling all data for all units it pull nothing.

The criteria in the query is
Criteria: [Forms].[ProgramFS]![cboUnit]
a couple questions. How are you filling the items in the combo box (1w, 2w, 3w, all)? Is it via code or is it pulling from a table? For your current question, a sufficient answer may depend on that.

One of the things that you could do is just add a command button to your form near the combo box that says "pull all units" or something like that. Then code the button to either pass a "*" wildcard through your query, or set it up to run on a separate query that pulls all data.
Oct 2 '07 #2
chauser
3 New Member
a couple questions. How are you filling the items in the combo box (1w, 2w, 3w, all)? Is it via code or is it pulling from a table? For your current question, a sufficient answer may depend on that.

One of the things that you could do is just add a command button to your form near the combo box that says "pull all units" or something like that. Then code the button to either pass a "*" wildcard through your query, or set it up to run on a separate query that pulls all data.

I have a value list in the combo box. I would set up another query to pull all but there are about twenty queries that use the same data on this form, specifically the unit. I would have to create a an additional query for each type of the existing ones just to pull all units. I was hoping there was a way to pass a "*" through the query. How do I do this?
Oct 4 '07 #3
chauser
3 New Member
I have a value list in the combo box. I would set up another query to pull all but there are about twenty queries that use the same data on this form, specifically the unit. I would have to create a an additional query for each type of the existing ones just to pull all units. I was hoping there was a way to pass a "*" through the query. How do I do this?

I was able to figure out the problem. I changed the Criteria for the field to

Criteria: IIf([Forms].[ProgramFS]![cboUnit],[Forms]![ProgramFS]![cboUnit],Null)

and added an additional field

Field: [Forms]![ProgramFS]![cboUnit]
Criteria: ="*"

Works Beautifully!
Oct 4 '07 #4

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

Similar topics

5
7248
by: Julia Baresch | last post by:
Hi everyone, I haven't found any reference to this problem on this group or in Access 97 help. I hope someone here knows this - probably a simple thing, but not obvious. I designed a query to pull payment data from my database for accounting. It has 3 tables with one-to-many joins: Table1 --> one-to-many --> Table2 --> one-to-many --> Table3 The payment amount field is in Table3. I entered a few negative
2
2040
by: Scott Baird | last post by:
HELP!!! I've got a DB with two tables (relationships with a autonumber). The database works just fine, but I've got a report I simply can't make work. I've made a query that uses data from both tables. Table A contains all the basic data about individual valves (such as valve number, location, type, etc.). Table b contains a history of work performed on the individual valves (such as date tested, test performed by, etc). A basic...
3
1349
by: Tommy | last post by:
My recent project contains such kind of requirnment, we display the data in a datagrid, and frequently, the underlying data is subjected to change. We want to implement a 'pull model' website which will push the data to the client's browser from the server side at a fixed interval. I am considering the way to be javascript+webservice,which javascript plays the role of refreshing the datagrid. I am not an expert of ASP.NET, I guess there...
1
1402
by: David Lozzi | last post by:
It use to be so easy in ASP, but now in ASP.NET i'm lost and confused. I'm trying to connect to a SQL database, open a table via a SQL string. Then take the returning recordset and do what I want to it: pull two fields, pull all fields, loop through the recordset, etc. But i'm lost... -- David Lozzi
2
3771
by: Nick | last post by:
What I want to do is have 2 pull down lists, for example a state pull down list and a city pull down list. What I would like to have done is when you select a state from the state pull down list then the city pull down list will populate with all the cities from that selected state. I know that is a lot of data but that is just an example. Or something like when you are looking up cars online they have a make pull down list and a model...
4
1932
by: sparks | last post by:
We have a new project here, one that I have never tried maybe its easy I don't know yet. We have people that have records dating back over 5 yrs on a sql server. We have to build an access 2003 database for data entry of the people then pull data from the sql server to fill in data for these records. that sounds good....except to start I need record # and date....no problems there.
1
4000
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. Depends on the pull down list selection, I use script.aculo.us to validate the user input before submit and pass the necessary data, such as contact type, contact information and ranking to a php program for updating. This form should allow multiple...
5
4004
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make Fields Names: countrycode, make
5
1856
by: Yarda | last post by:
Hello, I am new to php and databases, we have an intranet and I have installed apache, mysql and php. We want to index, catalog and serve mp3 files from a web page using the above mentioned software. Could I be directed to tutorials that would explain how this is done. Thanks, Yarda
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2335
muto222
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.