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

Home Posts Topics Members FAQ

Query from Form Using All (*) as a selection option in a Combo box

MattFitzgerald
30 New Member
I have a combo box [ComboSelectGPAgent] on the form [Frm_Main_Menu] which is used as the criteria for a field [GP Agent] in the query [Qry_Cadbury_Data_Linked_to_BT_Data_By_Vol].

I want to be able to run the query for a specific [GP Agent] or all agents. I have added to the row source of the combo box the following code:-

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT Qry_Cadbury_Data_Linked_to_BT_Data_By_Vol.[GP Agent] FROM Qry_Cadbury_Data_Linked_to_BT_Data_By_Vol; UNION SELECT '*' AS [GP Agent] FROM Qry_Cadbury_Data_Linked_to_BT_Data_By_Vol;
and added the following code to the crieria of field [GP Agent] in my query:-

Expand|Select|Wrap|Line Numbers
  1. [Forms]![Frm_Main_Menu]![ComboSelectGPAgent]
The combo box now includes the option * but when I select * my query returns no records. if I select a specific GP Agent the query does return the records for the GP Agent

Please can some one explain why my wildcard does not work when picked up from the Combo Box from my form and how I can get this to work.

Much Appreciated!
Sep 11 '07 #1
3 1548
MMcCarthy
14,534 Recognized Expert Moderator MVP
Change the criteria to

Expand|Select|Wrap|Line Numbers
  1. Like [Forms]![Frm_Main_Menu]![ComboSelectGPAgent]
  2.  
The wildcard will only work with a Like statement
Sep 13 '07 #2
MattFitzgerald
30 New Member
Problem solved

I was just one word out on my code but that one word makes all the differece.

Thank you for taking the time to look at my problem I have been trying to solve it for a few day and without your help I would have spent many more hours on this.

and bonus I think it may help me solve another problem I'm facing I'm going to try it out now.
Sep 13 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
You're welcome. Glad its working for you.
Sep 13 '07 #4

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

Similar topics

2
by: Inquiring_Mind | last post by:
i am creating a database. i have the following question.. as per the specs... i need to be able to pull other forms from the master form using either a list or a combo box. what is the...
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
5
by: Col | last post by:
I have a query with criteria that comes from a combo box on a form. I'd like to set the query up so the user can either limit the criteria to the selection in the combo box or the user can pull all...
5
by: jjyconsulting | last post by:
Newbie needing some help. I have a tblParticipants. The fields include gender, education_level, income, occupation etc., I'm trying to create a form where a user can run a query from the form and...
20
by: JC21 | last post by:
Hello, I have build databases before but they were simple ones. I am having difficulties with this one. If someone could assist me it would be greatly appreciated. I have two issues I am not able to...
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
1
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just...
3
hyperpau
by: hyperpau | last post by:
Hi there guys! I have a Form where there are three comboboxes. This comboboxes are used as references for the parameter of 3 fields in a query. when I hit a command button in my form, it opens...
1
by: StuartD | last post by:
I have a sub form that is populated based on the selection of a year from a combo box on the main form. I'm trying to add a second main form combo box for item category to further filter the sub...
0
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
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,...
0
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
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
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
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
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
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...
1
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.