Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Query on Form 1

Status
Not open for further replies.

RDM23

Technical User
May 16, 2007
39
US
I have a form where I need to audit to see if either of the options are checked. Something like If Field1=-1 or Field2=-1,"Yes","No. (This is for a checkbox on a form. I need to ensure that only Field1 or Field2 is checked which would display a -1. This is just an audit on the bottom of the page that checks to see if one of these fields is checked. Thanks in advance.
 
To fix your expression for use on a form...

Controlsource:

Code:
= IIf (Field1 Or Field2,"Yes","No")

Although your text describes you want only one of the checkboxes checked which implies not both.

Controlsource:

Code:
= IIf (Field1 XOR Field2,"Yes","No")
 
Thanks for the response lameid. That worked great. Another question I have is this. On the form, I have Field 1 and Field 2 as the checkbox options. If they select checkbox field 1, then select checkbox field 2, I would like to have checkbox field 1 to go unchecked. This would allow them to only check 1 or the other. Currently they can select both checkbox field 1 and checkbox field 2.
Thanks.
 
Why not using an OptionGroup ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Great Idea. Thanks so much for you help. Very much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top