Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#218263 - 09/06/2004 13:07 Access Question
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
Assume I have a database with a field that may or may not be null. It is easy to make a query based on this to list all records that are empty of that have data in this particular field. What I am looking for is a way to represent the presence of data with a checkbox on a report that shows ALL records, not a filtered subset. Is this possible?

Top
#218264 - 09/06/2004 13:44 Re: Access Question [Re: lectric]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Of course, but I have the feeling that you're talking about a specifc tool, and without knowing what tool that is, there's no way to help you.

Edit: You know, if I'd read the title....


Edited by wfaulk (10/06/2004 08:46)
_________________________
Bitt Faulk

Top
#218265 - 09/06/2004 16:04 Re: Access Question [Re: lectric]
Mach
old hand

Registered: 15/07/2002
Posts: 828
Loc: Texas, USA
I believe that you can use the isnull function which returns a true/false result. You can use this directly in the Access QBE grid definition or within a control on a form.

If I understand what it is that you are trying to do, you'll likely want to use in the query definition.

IsNull Function


Returns a Boolean value that indicates whether an expression contains no valid data (Null).

Syntax

IsNull(expression)

The required expression argument is a Variant containing a numeric expression or string expression.

Remarks

IsNull returns True if expression is Null; otherwise, IsNull returns False. If expression consists of more than one variable, Null in any constituent variable causes True to be returned for the entire expression.

The Null value indicates that the Variant contains no valid data. Null is not the same as Empty, which indicates that a variable has not yet been initialized. It is also not the same as a zero-length string (""), which is sometimes referred to as a null string.

Important Use the IsNull function to determine whether an expression contains a Null value. Expressions that you might expect to evaluate to True under some circumstances, such as If Var = Null and If Var <> Null, are always False. This is because any expression containing a Null is itself Null and, therefore, False.

Top
#218266 - 09/06/2004 21:20 Re: Access Question [Re: Mach]
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
OK, got it. In a query, I brought in the field that contained the data I was looking for. In another field I used "expr1: [field1] is null". That returned a boolean 0, -1 value which translated easily into a checkmark on a report. Thanks for the input.

Basically what it is is a list of all my movies/cd's. I had a field that showed who had "check out" a particular item. The field contained the person's name. If it was null, I wanted to show that it was not "checked out" Later, I wanted to be able to print out a report listing all my stuff, showing whether an item was "in stock" without having to show who actually had it checked out, since that's nobody's business but mine. And I wanted to be able to do this without having to check off a button in the lookup form. More or less it was an exercise to see how to do it, not that it was really necessary.

Make sense?

Top
#218267 - 09/06/2004 21:48 Re: Access Question [Re: lectric]
Mach
old hand

Registered: 15/07/2002
Posts: 828
Loc: Texas, USA
Makes sense.

You could also setup field on the report that did a if(len([checkedout])>0),"Checked Out","In Stock")

Top
#218268 - 10/06/2004 06:57 Re: Access Question [Re: Mach]
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
Ahhhh..... Elegant.

Top