J
Jeff Garrison
Allen -
I haven't tried doing the response that you gave me regarding the question
below. I'm having a major senior moment and can't figure out what the
DLookup syntax would be. Any help?
BTW the table name is tblContractorProjects...
Thanks
Jeff
-----------------------------------------
Use the BeforeUpdate event procedure of the form to perform the validation.
Use DLookup() to see if an overlapping entry exists in the table.
Assuming contractStartDate and contractEndDate are required fields (so you
don't have to handle overlapping dates when one of the fields is blank), the
dates overlap if:
A starts before B ends, AND
B starts before A ends.
and presumably it's the same contractor and/or project number as well.
So, the Criteria for your DLookup() will contain several phrases. Don't
forget ot exclude the contractID (i.e. an existing record does not clash
with itself.)
It may help to draw example events on paper like this:
A: StartDate-----------EndDate
B: StartDate-----------EndDate
C: StartDate------EndDate
to get the idea of how they overlap.
I haven't tried doing the response that you gave me regarding the question
below. I'm having a major senior moment and can't figure out what the
DLookup syntax would be. Any help?
BTW the table name is tblContractorProjects...
Thanks
Jeff
-----------------------------------------
Use the BeforeUpdate event procedure of the form to perform the validation.
Use DLookup() to see if an overlapping entry exists in the table.
Assuming contractStartDate and contractEndDate are required fields (so you
don't have to handle overlapping dates when one of the fields is blank), the
dates overlap if:
A starts before B ends, AND
B starts before A ends.
and presumably it's the same contractor and/or project number as well.
So, the Criteria for your DLookup() will contain several phrases. Don't
forget ot exclude the contractID (i.e. an existing record does not clash
with itself.)
It may help to draw example events on paper like this:
A: StartDate-----------EndDate
B: StartDate-----------EndDate
C: StartDate------EndDate
to get the idea of how they overlap.