I have a query where each customer has an [ID1] or [ID2]. Sometimes
both fields for a customer are populated, but if [ID1] is null, then
[ID2] will be populated and vice versa. I have a form,
[frmEligibility], where I select a value for [cboID1] from a combo
box. In my query I set the criteria for [ID1] to
[Forms].[frmEligibility].[cboID1]. My query finds the proper values
for [ID1].
Now I also want to find the values if I select a value for [cboID2] in
a separate combo box. In both controls, OnChange, I set the value of
the opposite control = "" so only one control has a value at one time.
In my query I want to find the record based on the control that is
populated. If [cboID1] = "", I don't want any criteria for [ID1] in
the query and [ID2] should be equal to [cboID2].
I set the criteria for the [ID1] field to:
IIf([Forms].[frmEligibility].[cboID1]<>"",[Forms].[
frmEligibility].[cboID1])
I set the criteria for the [ID2] field to:
IIf([Forms].[frmEligibility].[cboID2]<>"",[Forms].[
frmEligibility].[cboID2])
This does not work and I want [cboID1] and [cboID2] to remain on the
same form. Any suggestions?
Thanks 2 2899
neptune wrote: I have a query where each customer has an [ID1] or [ID2]. Sometimes both fields for a customer are populated, but if [ID1] is null, then [ID2] will be populated and vice versa. I have a form, [frmEligibility], where I select a value for [cboID1] from a combo box. In my query I set the criteria for [ID1] to [Forms].[frmEligibility].[cboID1]. My query finds the proper values for [ID1].
Now I also want to find the values if I select a value for [cboID2] in a separate combo box. In both controls, OnChange, I set the value of the opposite control = "" so only one control has a value at one time. In my query I want to find the record based on the control that is populated. If [cboID1] = "", I don't want any criteria for [ID1] in the query and [ID2] should be equal to [cboID2].
I set the criteria for the [ID1] field to: IIf([Forms].[frmEligibility].[cboID1]<>"",[Forms].[ frmEligibility].[cboID1]) I set the criteria for the [ID2] field to: IIf([Forms].[frmEligibility].[cboID2]<>"",[Forms].[ frmEligibility].[cboID2])
This does not work and I want [cboID1] and [cboID2] to remain on the same form. Any suggestions? Thanks
Maybe inverse the fields and the controls. If you put the form fields in
the top row (as if they were in the table) and use this as criteria:
Is Null or =[id1]
does that work?
--
Bas Cost Budde http://www.heuveltop.org/BasCB
but the domain is nl bs**********@hotmail.com (neptune) wrote in message news:<c5**************************@posting.google. com>... I have a query where each customer has an [ID1] or [ID2]. Sometimes both fields for a customer are populated, but if [ID1] is null, then [ID2] will be populated and vice versa. I have a form, [frmEligibility], where I select a value for [cboID1] from a combo box. In my query I set the criteria for [ID1] to [Forms].[frmEligibility].[cboID1]. My query finds the proper values for [ID1].
Now I also want to find the values if I select a value for [cboID2] in a separate combo box. In both controls, OnChange, I set the value of the opposite control = "" so only one control has a value at one time. In my query I want to find the record based on the control that is populated. If [cboID1] = "", I don't want any criteria for [ID1] in the query and [ID2] should be equal to [cboID2].
I set the criteria for the [ID1] field to: IIf([Forms].[frmEligibility].[cboID1]<>"",[Forms].[ frmEligibility].[cboID1]) I set the criteria for the [ID2] field to: IIf([Forms].[frmEligibility].[cboID2]<>"",[Forms].[ frmEligibility].[cboID2])
This does not work and I want [cboID1] and [cboID2] to remain on the same form. Any suggestions? Thanks
Sounds like a normalization issue! One way of dealing with this is to
use a stored query and modify the SQL based on what's been chosen.
You'd just store the query with no WHERE clause, then trim off the
semi-colon, add the valid where clause based on what's been chosen and
update the SQL property of the querydef in question. then you can
open the query. Of course, if you normalized, you'd only have one
field to query, and your problems would go away. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steve |
last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's
criteria is set ats:
Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the
selections are 30, 60...
|
by: James |
last post by:
Dear group,
Can anyone tell me how to do the following?
I have a basic list of numbers in a table
I want to be able to search these by letting the user type "<10" or
">=50" on a simple form...
|
by: RBohannon |
last post by:
I have a report with most fields populated by a query. However, some
of the fields are variable in such a way that their values cannot be
queried from a table. At present the values for these...
|
by: Andy |
last post by:
Hello,
I am having many problems with setting up a parameter query that
searches by the criteria entered or returns all records if nothing is
entered.
I have designed an unbound form with 3...
|
by: dkintheuk |
last post by:
Hi all,
Using Access 2000 on XP Pro PC.
I have a form that is based on a presaved query - all fine with this.
I also have a refresh button that takes the values from various unbound...
|
by: dskillingstad |
last post by:
I'd appreciate any help I can get. I'm not sure what I'm doing wrong,
but....
I've searched these groups for some solutions but no luck.
I have an unbound form (frmSearch), with several unbound...
|
by: angie |
last post by:
I need to figure out how to create a user interface to search a query,
but here's the bad part...I need to account for criteria on at least 7
of the fields. Here's what I'm thinking I need to do:...
|
by: SeanCly10 |
last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm
somewhat limited in my coding knowledge, and I need some advice and
help.
I'm working on a database that will eventually be used...
|
by: dizzydangler |
last post by:
Hi all,
I am a new Access user and just starting to get my head around some of the basic concepts, so please take it easy on me :) My company has been managing client records on excel, and I’m in...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |