A date collsion occurs when
dtStartDate <= TestEndDate
and
dtEndDate >= TestStartDate
So, code to check the above would look like (warning...air code off the top
of my head..).:
dim strSql as string
dim strdStart as string
dim strdEnd as string
dim rstCheck as dao.RecordSet
strdStart = "#" & format(userTestStartDate,"mm/dd/yyyy") & "#"
strdEnd = "#" format(userTestEndDate,"mm/dd/yyyy") & "#"
strSql = "select * from tblof Dates where StartDate <= " & stdEnmd & _
" and EndDate >= " & strDStart
set rstCheck = currentdb.OpenRecordSet(strSql)
if rstCheck.RecordCount > 0 then
msgbox "there is collsions"
else
' ok
msgobx "there is no collsion"
end if
rstCheck.Close
set rstCheck = nothing
So, the query to do this is VERY easy.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)
http://www.attcanada.net/~kallal.msn