JGalletta
Windows 7 Access 2010
- Local time
- Today, 03:56
- Joined
- Feb 9, 2012
- Messages
- 149
I'm currently creating a database to manage pesticide applications for a farm. Each pesticide application has an REI (Re entry interval) that restricts entry into a given field on the farm for a given amount of time. I've easily programmed the database to calculate the Re-Entry date based on the date of application and the REI.
What I would like to do next is change the value of all re-entry dates for each field to reflect the value of the highest or latest re-entry date.
I'm hoping this is a simple calculation using DMax, but my problem arises here:
The re-entry is calculated from two different tables. (say Application Record and Chem Info) using DateAdd as follows.
Will I be able to use DMax when the Max value being generated is calculated using fields from two different tables like above?
My early attempts at doing this look something like this - so you know where I'm trying to get with this.
Keep in mind that this is in a report (named in the domain part of the DMax string.).
Thanks in advance for any help offered on this subject. Feel free to ask for more info, I'll try to respond as soon as possible.
Regards,
John
What I would like to do next is change the value of all re-entry dates for each field to reflect the value of the highest or latest re-entry date.
I'm hoping this is a simple calculation using DMax, but my problem arises here:
The re-entry is calculated from two different tables. (say Application Record and Chem Info) using DateAdd as follows.
Code:
DateAdd("h",[tblPesticides]![REI],[tblApplicationRecord]![Date of Application]+[tblApplicationRecord]![Time])
Will I be able to use DMax when the Max value being generated is calculated using fields from two different tables like above?
My early attempts at doing this look something like this - so you know where I'm trying to get with this.
Code:
DMax((DateAdd("h",[tblPesticides]![REI],[tblApplicationRecord]![Date of Application]+[tblApplicationRecord]![Time])),[Reports]![AppRecord],"Me.Field Number ='" & [tblFieldApps].[Field] & "'")
Keep in mind that this is in a report (named in the domain part of the DMax string.).
Thanks in advance for any help offered on this subject. Feel free to ask for more info, I'll try to respond as soon as possible.
Regards,
John