473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Is it possible for a query to accept values from 2 diff locations?

Hi, I have a query with the criteria of
([forms]![frm_SearchCandidates].[qmyList].[value]) Or
[forms]![frm_CustomQuery].[lstResults].[value]

When I provide the value from qmylist, a second pop up appears waiting
for the value from lstResults. If I enter nothing and click ok, it works
fine. (Vice versa)

Is there a way to suppress the popup if only 1 of the value is supplied?
There by working truly as an OR?

Thanks a lot!!

*** Sent via Developersdex http://www.developersdex.com ***
Jan 23 '06 #1
2 1197
The query uses the Expression Service (ES) to try to resolve the parameter
name. If the form is open, the ES succeeds, and so the query uses the value
in the control on the form and does not ask the user for the parameter
value. If the form is not open, the ES is not able to resolve the name, and
so the query does pop up the parameter dialog.

To the query, the OR in the critieria means it has 2 possibilites to
consider. For some cases at least, it must consider both. For example, it is
possible that both forms are open, but neither value matches, but that can
only be determined by examining both.

It would be possible to code around the issue with a function call in your
WHERE clause that attempts to read the value only if:
CurrentProject.AllForms("frmSearchCandidates").IsL oaded

But the better solution would probably be to leave the criteria out of the
query, and apply it later, at whatever point you are working. For example,
you might set the Filter of the particular form, or use the WhereCondition
of OpenReport, or build the entire SQL string in code and apply it to the
SQL property of the QueryDef, the RecordSource of the form or Report, or
OpenRecordset() in code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"jim Bob" <fr****@gmail.com> wrote in message
news:Py*****************@news.uswest.net...
Hi, I have a query with the criteria of
([forms]![frm_SearchCandidates].[qmyList].[value]) Or
[forms]![frm_CustomQuery].[lstResults].[value]

When I provide the value from qmylist, a second pop up appears waiting
for the value from lstResults. If I enter nothing and click ok, it works
fine. (Vice versa)

Is there a way to suppress the popup if only 1 of the value is supplied?
There by working truly as an OR?

Jan 23 '06 #2
thanks Allen :)

*** Sent via Developersdex http://www.developersdex.com ***
Jan 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: aaron | last post by:
I have a question about (i think) joining. If I have a table in a database that has this info: key - name - favorite 1 - john - 2 2 - judy - 3 3 - joe - 1 the favorite icecream...
4
by: Bacci | last post by:
I have two tables. The first is "Locations" which has 52,000 zip codes w/cooresponding latitudes and longitudes. The second "Suppliers" has 2,000 company names and addresses. The user enters a...
4
by: Jorgen Gustafsson | last post by:
Hi, im trying to write a small progam to compare data in 2 textfiles. I want to search for values that doesnt exist in File2. The result should be "3" in the example below but Im not able to do...
22
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
1
by: maxmarengo | last post by:
I am trying to write a query in Access (or SQL) that works on a table like this: Location Gridreference Ben Nevis NQ1234512345 Ben Doon NQ1230012300 and so on for several thousand...
3
by: I_was_here | last post by:
Hey if anyone is a query pro please showoff some knowledge thx. Ie: I have a table with : part price location qty 1 part repeats throughout the table and its price remains the same but it...
3
by: Jeff Kish | last post by:
Hi. I'm trying but not getting correct results. I have two tables one with app, msg, time (varchar,datetime,varchar) app1 start 2006-04-03 13:33:36.000 app1 stuff 2006-04-03...
1
by: vncntj | last post by:
I have a C#.NET that simply passes 6 values to a Stored Procedure. But I'm trying to get the (Default.aspx.cs page) to handle passing the values to the sp. The goal is to pass the values and see...
4
by: rdsandy | last post by:
Hi, I have some code below in VBA for Access 2003 which is on a button called "RentalCrosstabPercTtlQtyMonthLoc_Click". This is a crosstab query which brings up rental items down the side, who...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...

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.