However, it "seems" like MRN and subsequent transactions against that MRN should be a
one to many relationship... a main table/form for the original MRN, MRNDate, and IRN, and
a related table/subform to hold all subsequent "trasnsactions" against that MRN... rather
than multiple "single record" transactions.
I can't be sure about that from your brief info, but you might want to consider that
option.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
"t4tm" <t4...@discussions.microsoft.com> wrote in message
news:1EC310C8-1B97-42CF...@microsoft.com...
> My first record contains MRN, date, INR. I would like the records that
> follow (based on matching MRN's) to pick up the previous date and previous
> INR, then perform a calculation on the current date and previous date. Is
> this possible?
MRN MRNDate INR
MRN MRNDate INR PrevINR PrevDate Calculation
MRN MRNDate INR PrevINR PRevDate Calculation
Are you saying you always need to find the "last" entry against that MRN?
Does each new recoird have a new INR?
If so then your records should contain a TransDate (the date of the new record), and
the Dlookup would use the DMax of the TransDate as a criteria to correctly identify the
"last" existing entry against that unique MRN. That would give you the PrevINR and
PreviousDate for that your new MNR record.
Try this...
> MRN MRNDate INR PrevINR TransDate PrevDate Calculation
> MRN MRNDate INR PrevINR TransDate PrevDate Calculation
> MRN MRNDate INR PrevINR TransDate PRevDate Calculation
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
"t4tm" <t4...@discussions.microsoft.com> wrote in message
news:E6234880-EA63-42C8...@microsoft.com...
MRN MRNDate INR PrvINR TransDate Calculation
123456 01/01/2006 2.1 01/03/2006
111111 01/01/2006 2.8 01/03/2006
123456 01/15/2006 2.5 2.1 01/17/2006 14
111111 01/15/2006 3.0 2.8 01/17/2006 14
123456 02/01/2006 2.6 2.5 02/02/2006 17
111111 02/01/2006 3.1 3.0 02/02/2006 17
Your help is greatly appreciated.
Private Sub MRN_AfterUpdate()
Dim PrevTransDate As Date
PrevTransDate = DMax("[TransDate]", "tblINR", "MRN = " & [MRN])
PreviousINR = DLookup("[INR]", "tblINR", "TransDate = #" & PrevTransDate & "# and MRN
= " & MRN)
End Sub
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
"t4tm" <t4...@discussions.microsoft.com> wrote in message
news:C8CE6826-7CC8-49D1...@microsoft.com...
-Aaron