Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

MS Access

Dec 7, 2004 10:14PM PST

I have an access database with a field that uses a data type of yes or no, (its called no charge) If the user checks the box on the form it won't print that persons info in the report. Can someone help me out on this. Thank you very much.

Discussion is locked

- Collapse -
Re: MS Access
Dec 8, 2004 6:13AM PST

Jnpeanut,

"I've got a database with a field".
I've got only fields in table. And some of these are yes/no-fields indeed (you might call them Booleans, if you like).

"Its called no charge".
It doesn't matter how it is called, although I doubt (and not in the mood to try) if a space can be part of a field name. Mostly one uses an _ for that purpose. But it doesn't really matter.

The field is on a form, and it can be checked and unchecked. That's how things go.

"it won't print"
It = MS Access?

"the report"
Have a look at the query that the report uses. Maybe the query contains an selection on this field. The solution then would be to change the query.

Hope this helps.


Kees

- Collapse -
Re: MS Access
Dec 9, 2004 4:35AM PST

If I understand correctly, you only want to include those on the report who do not have the checkbox marked. The query that is the basis for your report can handle that. Something like this:

"SELECT * FROM MyTable WHERE [No Charge] = 0"

I believe that Access will store a 0 (false) or a -1 (true) in the [No Charge] column in the table, based on whether or not you've checked the box. If that doesn't work, replace the 0 with the word FALSE.

- Collapse -
Booleans
Dec 9, 2004 6:51AM PST

Smeyer,

I note that even experienced programmers (I don't know of course if you're one, so please don't be insulted if you are!) nowadays tend to write:
if my_boolean = true
in stead of simply
if my_boolean

And
if my_boolean = false
is equivalent to
if not my_boolean

That's how we used to learn it in the old days.

For jnpeanut, by the way, the query-GUI (design view) might be more apt than the SQL-view. But that's much more work to explain in a full-text post, of course.

Kees