If this field is blank, display the info from THIS field...

G

Guest

Greetings. Is there anyone out there who can suggest an answer to this
problem?

For each record in an access table, I am trying to write a function that
will do the following:

If field A (under column A) has a number value, and field B (under column B)
is blank, then remember this value and add it to any other fields where the
same conditions apply. See example:

Columns: A B

Record1 4
Record2 6 6
Record3 5 5
Record4 3
Record5 2


In my query, the result I am looking for above would be 9, because it is
summing all of the records where there is a value in column A, but no value
in B. Is this something that Iwould write in the wuery? Thanks in advance :)
 
G

Guest

Set the control source property of a text box on a form to

=DSum("[A]","Your Table Name","[A] > 0 And Isnull()")
 
G

Guest

Another way is to create a query and put Field A and Field B as the 2 columns.
Click on the totals button and change Group By on field A to Sum and change
Field B to Where. Put criteria of Is Null against Field B and run the query.
 
G

Guest

Dennis, I used the second option and it worked beautifully. Thanks a lot for
your help.
 

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