N
Newbie
I am trying to find the next available date that is not a holiday.
The holiday dates are in a table.
The code works for the first pass through but once the date has been found
and 1 has been added to give the next date to evaluate I get the error
invalid use of Null.
When I hover over the variable a valid date appears.
Here is the code snippet
Do
blnFound = (DLookup("HolidayDays", "tblHolidayDates",
"[HolidayDays]=#" & dtmTemp & "#")) ' this is where error occurs
If blnFound Then
dtmTemp = dtmTemp + intIncrement
End If
Loop Until Not blnFound
In my table I have all the dates from 1st June to 4th June. If I send a
date of 1st June blnFound returns true and dtmTemp is incremented by 1 to
give dtmTemp a value of 2nd June. When trying to evaluate blnFound for the
2nd time the error 94 Invalid Use of Null is returned.
Where am I going wrong?
All help greatly appreciated
The holiday dates are in a table.
The code works for the first pass through but once the date has been found
and 1 has been added to give the next date to evaluate I get the error
invalid use of Null.
When I hover over the variable a valid date appears.
Here is the code snippet
Do
blnFound = (DLookup("HolidayDays", "tblHolidayDates",
"[HolidayDays]=#" & dtmTemp & "#")) ' this is where error occurs
If blnFound Then
dtmTemp = dtmTemp + intIncrement
End If
Loop Until Not blnFound
In my table I have all the dates from 1st June to 4th June. If I send a
date of 1st June blnFound returns true and dtmTemp is incremented by 1 to
give dtmTemp a value of 2nd June. When trying to evaluate blnFound for the
2nd time the error 94 Invalid Use of Null is returned.
Where am I going wrong?
All help greatly appreciated