SQL issue with "either true or false"

H

Haeske

Hi,

I have a database where I keep track of -amongst others- purchase orders with line items. The form for this table contains the following fields:

IsWordRate NumberOfWords NumberOfHours RateType Rate Amount

On the form, chkIsWordRate is a triple-state checkbox. When the NumberOfWords field has focus, IsWordRate is True; when the NumberOfHours field has focus, IsWordRate is False; when the Rate field has focus, IsWordRate is Null.

Currently, the HAVING clause for the SQL code in the RateType's ControlSource is as follows:

HAVING (((IsWordRate)=IIf([chkIsWordRate],True,IIf([chkIsWordRate] Is Null,True OR False,False))

When I set focus to the NumberOfWords or NumberOfHours fields, I see the wordrates or hourly rates only, and this is correct. However, when I set focus to the Rate field, I'd like to see all records, regardless of the IsWordRate field. How do I do this in the above HAVING clause - obviously the "True OR False" part is not working, but what is the correct syntax? I've tried "Is Not Null", "<> Null", "Or(True,False)", and "*", but nothing works.

Any help is greatly appreciated! :)

Many thanks!
Mark
 

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