Hi,
I need help typing up an Event in VBA code which would retrieve the value from the same field in a previous record.
Right now I'm using this in the Control Source of a subform to look up the previous data.
=IIf(IsNull(([txtVol]-1)),0,DLookUp("regdollar","tblVolume","[VolumeID]= ( [txtVol] - 1 )")
txtVol is the key for the table, (the field name is VolumeID) and is an autonumber. Unfortunatly, this won't work for me because [txtVol] is not a reliable autonumber.
The pseudo code I'm having troubles translating to VBA is the following:
"Return the value from [regdollar] in the table [tblvolume] FROM the previous record WHERE DeptID is the same."
How would this look and would this be put in the Before_Update Event?
Thnx
-Toby Kliem- sapere aude: Dare to be wise
I need help typing up an Event in VBA code which would retrieve the value from the same field in a previous record.
Right now I'm using this in the Control Source of a subform to look up the previous data.
=IIf(IsNull(([txtVol]-1)),0,DLookUp("regdollar","tblVolume","[VolumeID]= ( [txtVol] - 1 )")
txtVol is the key for the table, (the field name is VolumeID) and is an autonumber. Unfortunatly, this won't work for me because [txtVol] is not a reliable autonumber.
The pseudo code I'm having troubles translating to VBA is the following:
"Return the value from [regdollar] in the table [tblvolume] FROM the previous record WHERE DeptID is the same."
How would this look and would this be put in the Before_Update Event?
Thnx
-Toby Kliem- sapere aude: Dare to be wise