Problem is still present

S

sajid munir

Dear Sir
I have used the following cmmonds in query

1:- " is not null"

2:- SELECT tblProducts.ProductName, tblProducts.Weight
FROM tblProducts
WHERE (((tblProducts.Weight) Is Not Null));

3:- WHERE ((Len(tblProducts.Weight) > 0 ));

But my problem is still present because

I want to see only non empty fields in report.
When I use "is not null" in the query below all the
fields. It show me only those records in which no field
is empty and It leave all those records in which one or
more than one record is empty.
For example
i have a form as below for selling fruits


Orages 2 kilo
mango 5 kilo
banana (empty)
apple 6 kilo
pine apple (empty)
Grapes 3 kilo

i want to see the report of only non empty fields without
space as below.

Orages 2 kilo
mango 5 kilo
apple 6 kilo
Grapes 3 kilo

I also have used the folowing "visual basic code" in
report

if banana.text=empty then
banana.visible=false

Then it shows only non empty result but with
blank spaces like bellow


Orages 2 kilo
mango 5 kilo

apple 6 kilo

Grapes 3 kilo

which is not my requirement.
I want the report as below,

Orages 2 kilo
mango 5 kilo
apple 6 kilo
Grapes 3 kilo
Please help me.
 
G

Gary

Have you tried designing a query and using the output (i.e. the two fields
[ProductName] and [Weight] and use IsNotNull in the criteria. I can't see
what Access would return null results if you ask it not to. Design your
report on the output of your query. And are you using two WHERE statements
at the end of the query (WHERE ([tblProducts].[Weight] Is Not Null) and
(WHERE Len([tblProducts].[Weight] > 0))?? That's confusing.

as an aside, in the VBA section below you wrote:

If banana.text=empty Then
banana.visible = False

you want to say:
If banana.text="" Then
banana.visible = False

This will present blank lines as you encountered, because Access was told to
show the field, then it's told to hide it. That's not the way to generate
the report you want. I think you want report based on the query, you can
even use a Report Wizard to generate it.
 

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