473,782 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Hi, I have a query with the criteria of
([forms]![frm_SearchCandi dates].[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 1216
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("frmSe archCandidates" ).IsLoaded

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.c om> wrote in message
news:Py******** *********@news. uswest.net...
Hi, I have a query with the criteria of
([forms]![frm_SearchCandi dates].[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
5558
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 table is this:
4
2387
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 zip code and the cooresponding latitude and longitude is return. $sql = "SELECT l.latitude, l.longitude "; $sql .= "FROM Locations l"; $sql .= "WHERE l.zipcode = ".$zip;
4
4735
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 this since my program crosschecks all numbers in both files and Im getting a lot of "hits". (outer and inner while-loops) Below is an examples of the textfiles:
22
3068
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 3, NULL, 9, 82, 25
1
1403
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 records. I have a function that calculates the distance between two points. What I want to do is write a query that will list for each point in
3
2970
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 has multiple locations so I'll have entries like:
3
2156
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 13:33:36.000 app1 end 2006-04-03 13:33:36.000
1
2118
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 if any records are returned. I will later insert some conditional statements. Here is my Default.aspx.cs protected void btnNext_Click(object sender, EventArgs e) {
4
2490
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 rents along the top, the rental month and total number of each item on that month as rows next to the item, something like this: Item TotalQty Month Renter1 Renter2 .... PC 234 Aug-2007 2.33 4.55 ...
0
9480
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
10313
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
10146
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...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
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...
0
5378
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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 we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.