Help with two lines adding

  • Thread starter Thread starter jmagness
  • Start date Start date
J

jmagness

Hi all,

I am looking for with adding two lines in a table.

In a form/Table I have several numbers (Example below)

Index Amount #1 Difference
------- --------- ----------
1 $3.00 $0.00
2 $4.00 $1.00
3 $6.00 $2.00

What I need help with is the process in Access to have
the system calculate the Difference field

The difference is gotten by taking Index#2 from Index #1,
etc....

The problem is getting the number from the previous line
to use in the present line.

Any help would be great,

Thank you in advance,

Jay
 
Try using the DLookUp() function.

Set the Difference text box control source property to:
"=[Amount #1] - DLookup("[Amount #1]","[Your table
name]","Index=" & Index-1)"

Make sure your form is ordered by Index.

Hope this helps
Hedi
 

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

Back
Top