A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculation between two records



 
 
Thread Tools Display Modes
  #1  
Old April 18th, 2009, 11:37 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Calculation between two records

Thanks for all your help in the past - here I am again with another stumper
for me - but not for most of you. Thanks.

I have two records in the same table Record A and Record B - along with
Records C-Z but I want to calculate RecordB - RecordA = Difference.

How can I do that in a form.

Here's the kicker (for me) I'd like the Difference txtbox to show B-A when I
click on B and C-B when I click on record C, and D-C when I click on record
D.

Thanks for your help!
Bob
  #2  
Old April 19th, 2009, 06:49 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Calculation between two records

You can use a subquery to get the difference between 2 records. Details:
http://allenbrowne.com/subquery-01.html#AnotherRecord

The meter-reading example (current value less previous reading) should be
relevant. But be aware that:
- the results will be read-only (i.e. you can't edit records in the form)
- the results won't adapt if you filter the form, or sort the records
differently.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bob Waggoner" wrote in message
...
Thanks for all your help in the past - here I am again with another
stumper
for me - but not for most of you. Thanks.

I have two records in the same table Record A and Record B - along with
Records C-Z but I want to calculate RecordB - RecordA = Difference.

How can I do that in a form.

Here's the kicker (for me) I'd like the Difference txtbox to show B-A when
I
click on B and C-B when I click on record C, and D-C when I click on
record
D.

Thanks for your help!
Bob


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.