J
Jonathan Stratford
Hi,
I'm trying to create a leave system, where if the user
requests leave which includes a special day - weekends
and public holidays - then the number of days in the
leave is decreased by one. I use the following code, but
as rs.recordcount returns -1, i can't go through the
records this way. Can anyone suggest the correct way to
do this?
Many thanks,
Jonathan Stratford
* TSpecialDays is a table which contains one field -
"Special Day Date"
Set con = CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
strSQL = "SELECT [Special Day Date] FROM TSpecialDays"
rs.Open strSQL, con, , , adCmdText
For i = Return_Date To Leave_Date
If rs.EOF Then Exit For
For j = 1 To rs.RecordCount
If i = j Then leavelength = leavelength - 1
Next
Next
I'm trying to create a leave system, where if the user
requests leave which includes a special day - weekends
and public holidays - then the number of days in the
leave is decreased by one. I use the following code, but
as rs.recordcount returns -1, i can't go through the
records this way. Can anyone suggest the correct way to
do this?
Many thanks,
Jonathan Stratford
* TSpecialDays is a table which contains one field -
"Special Day Date"
Set con = CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
strSQL = "SELECT [Special Day Date] FROM TSpecialDays"
rs.Open strSQL, con, , , adCmdText
For i = Return_Date To Leave_Date
If rs.EOF Then Exit For
For j = 1 To rs.RecordCount
If i = j Then leavelength = leavelength - 1
Next
Next