Using And/Or with Check Box

  • Thread starter joebeagle via AccessMonster.com
  • Start date
J

joebeagle via AccessMonster.com

I have a form (form1) with a subform (subform2) and another subform (subform3)
. On subform2 there is a text box for mom's employer's name. On subform3
there is a text box for dad's employer's name. On form1 there is a check box
(Check0) that needs to be filled in automatically when either mom or dad has
an employer, or left blank (false) if neither one has an employer.

I have tried several different solutions including:

Nz(Subform1.Form![Employer], Nz(Subform2.Form![Emplyer], False))

IIf (Not IsNull(Forms![Form1]![Subform1].Form![Employer]) And Not IsNull
(Forms![Form1]![Subform2].Form![Employer]), True, False)

Reversing the above IIf for IIf(Is Null).

Any of them seem to work correctly with one operator (EG mom's info), but
when adding the second operator , dad's info (EG And...), the check box
either stays True all the time, or False all the time.

Any ideas? Can this even be done?

Thanks in advance,

Carol Washburn
 
K

Ken Snell \(MVP\)

Assuming that you're using an expression as the checkbox's Control Source:

=(Len([Subform1]![Employer] & "")>0 Or Len([Subform2]![Employer] & "")>0)

Be sure that you're using the correct names for the subform controls (the
controls that actually hold the subform source objects) in the above
expression.
 
J

joebeagle via AccessMonster.com

Thank you! That worked fine!
Carol
Assuming that you're using an expression as the checkbox's Control Source:

=(Len([Subform1]![Employer] & "")>0 Or Len([Subform2]![Employer] & "")>0)

Be sure that you're using the correct names for the subform controls (the
controls that actually hold the subform source objects) in the above
expression.
I have a form (form1) with a subform (subform2) and another subform
(subform3)
[quoted text clipped - 23 lines]
Carol Washburn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top