473,388 Members | 1,606 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,388 software developers and data experts.

Yes No field on form and query

I have a form that I have a yes/no checkbox on it.

I would like to run a query based on the answer of this checkbox.

If the answer to the form checkbox is yes, I want to find yes items in
the query. If the answer to the checkbox is no I want to find both yes
and no items. I've tried several sinarios and have not had success.
Anyone have any ideas? I'm sure this has to be simple and I'm just not
thinking properly.

Here is on format I was trying -
IIf([Forms]![FORMSEARCH]![Individuals]=Yes,Yes,No Or Yes)
Thanks

Nov 13 '05 #1
4 6289
mar10 wrote:
I have a form that I have a yes/no checkbox on it.

I would like to run a query based on the answer of this checkbox.

If the answer to the form checkbox is yes, I want to find yes items in
the query. If the answer to the checkbox is no I want to find both yes
and no items. I've tried several sinarios and have not had success.
Anyone have any ideas? I'm sure this has to be simple and I'm just not
thinking properly.

Here is on format I was trying -
IIf([Forms]![FORMSEARCH]![Individuals]=Yes,Yes,No Or Yes)
Thanks


Maybe:

SELECT Data FROM tblMyData WHERE
IIf([Forms]![FORMSEARCH]![Individuals].Value=Yes, MyYNField = Yes,
(MyYNField = No Or MyYNField = Yes));

James A. Fortune

Nov 13 '05 #2
On 25 Sep 2005 14:05:28 -0700, mar10 wrote:
I have a form that I have a yes/no checkbox on it.

I would like to run a query based on the answer of this checkbox.

If the answer to the form checkbox is yes, I want to find yes items in
the query. If the answer to the checkbox is no I want to find both yes
and no items. I've tried several sinarios and have not had success.
Anyone have any ideas? I'm sure this has to be simple and I'm just not
thinking properly.

Here is on format I was trying -
IIf([Forms]![FORMSEARCH]![Individuals]=Yes,Yes,No Or Yes)

Thanks


Like IIf([forms]![FormSearch]![Individuals]=-1,-1,"*")
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3
fredg wrote:
Like IIf([forms]![FormSearch]![Individuals]=-1,-1,"*")


Très élégant!

James A. Fortune

Nov 13 '05 #4
ji********@compumarc.com wrote:
fredg wrote:
Like IIf([forms]![FormSearch]![Individuals]=-1,-1,"*")


Très élégant!

James A. Fortune


IN (Nz(Forms!FormSearch!Individuals), -1)

James A. Fortune

Nov 13 '05 #5

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

Similar topics

3
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the...
6
by: John Baker | last post by:
HI: I have a situation where I wish to enter a value in an unbound field on a form and then change the same field in each record on the form so that it reflects the value entered. THe form is...
1
by: j.mandala | last post by:
I have a memo field in an appointment application that stores session notes for group psychotherapy sessions. Each attendee of the group has an appointment record. I want to be able to write a...
1
by: Old Timer | last post by:
I wish to type in a number in my "Code" field, for instance 1060, I then wish the number 1060 to trigger an event that will fill in the next field (township field) For instance, 1060 brings up and...
3
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
5
by: ND | last post by:
I need to create a separate field from 4 fields, "street address", "city", "State" and "zip code". For example, Street address - 100 Forest Street City - Seattle State - WA Zip - 05555 ...
0
by: MLH | last post by:
I have an A97 query (qryVehiclesNowners2) that has a table field in it named . Depending on the selections made in a number of criteria choices on a form, a field on the form will have string...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
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...
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
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
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...

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.