Solved

Add "ALL" to list, not showing up in ACCESS 200 Table/Query statement

Posted on 2013-12-13
3
336 Views
Last Modified: 2013-12-13
I have the below and even if no data is in the table, I want the combobox to at leas show the term "[All]J".  However, while it works in two other comboboxes, I cannot get this one to display the [All] term even if there is no data from the other union statement.

SELECT "[All]" As ProjectFullID, "[All]" As ProjectName, "[All]" As ProjectID From tblProjects
UNION
SELECT tblProjectFTE.ProjectFullId, tblProjectFTE.ProjectName, tblProjectFTE.ProjectID
FROM tblProjects INNER JOIN tblProjectFTE ON tblProjects.ProjectID = tblProjectFTE.ProjectID
WHERE (((tblProjects.Status) Not In ("Closed","Excluded")));
0
Comment
Question by:ssmith94015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39717770
if ProjectFullId and ProjectID is numeric

SELECT 0 As ProjectFullID, "<All>" As ProjectName, 0 As ProjectID From tblProjects
UNION
SELECT tblProjectFTE.ProjectFullId, tblProjectFTE.ProjectName, tblProjectFTE.ProjectID
FROM tblProjects INNER JOIN tblProjectFTE ON tblProjects.ProjectID = tblProjectFTE.ProjectID
WHERE (((tblProjects.Status) Not In ("Closed","Excluded")));
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 39717776
It will happen if you select (anything, including an expression) from tblprojects, but tblProjects has no rows.

Create separate table with one row and select 'all' from that table.

In SQL Server you can select <something> without FROM, but in Access you have to select from table or from query.
0
 

Author Closing Comment

by:ssmith94015
ID: 39717800
That was it, there were no rows in the table!  I did not even think of that.  I put a seed row in and it works now.  Thank you,
0

Featured Post

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question