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

  • Thread starter Thread starter Guest
  • Start date Start date
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 :)
 
Set the control source property of a text box on a form to

=DSum("[A]","Your Table Name","[A] > 0 And Isnull()")
 
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.
 
Back
Top