
function checkDate(pDate)
    
    dim status
    '
    ' Needed to check length because for some reason
    ' isDate function thinks 12.28 is a valid date??????
    ' Don't allow 12.28.07
    if not isDate(pDate.value) or Len(pDate.value) < 8 or (instr(1,pDate.value,".") > 0) then
        msgbox("Please enter valid date")
        pDate.focus()
        pDate.select()
        status = false
    else
        status = true
    end if
    
    checkDate = status
    
end function
    
function checkDateValues(oStartDate, oEndDate)

    dim status
    
    status = true
    
    if cdate(oStartDate.value) > cdate(oEndDate.value) then
        msgbox("Please enter start date equal to or less then end date")
        oStartDate.focus()
        oStartDate.select()
        status = false
    end if
    
    checkDateValues = status
    
end function        