Hi,
Have a check printing routine - where the check register no longer prints correctly (check number no longer increments). The register's check number is based upon the number of lines detail section can handle - 92. A temporary table is created by a SQL command (Access 2000) that calls a function that no longer calculates the check number at all (returns zero). What was changed in Access 2000 that would preclude a piece of earlier code from working?
Here is the SQL Statement_______________________
SELECT DISTINCT Sum(VOUCHERS.VoucherAmount) AS SumOfVoucherAmount, Count(VOUCHERS.VoucherAmount) AS CountOfVouchers, Vouchers.AName, forms!main!unbcheck + increment(CountOfVouchers) AS CheckNum INTO temptable
FROM VOUCHERS LEFT JOIN Attorneys ON VOUCHERS.AName = Attorneys.AName
WHERE (((VOUCHERS.Status)='A'))
GROUP BY VOUCHERS.AName
ORDER BY VOUCHERS.AName;
- unbcheck - is the starting check number,
- increment(CountOfVouchers) is the function that is passed the number of detail lines on the 'checkstub'.
Here is the increment() function ___________________
(that no longer seems to work)
________________________________
Option Explicit
Dim incval As Integer
________________________________
Public Function increment(pvar As Variant) As Integer
Dim fitnum As Integer ' <<<This is the number of vouchers per check page>>>
fitnum = 93
Select Case pvar
Case 1 To fitnum
incval = incval + 1
Case (1 * (fitnum)) + 1 To (2 * (fitnum))
incval = incval + 2
Case (2 * (fitnum)) + 1 To (3 * (fitnum))
incval = incval + 3
Case (3 * (fitnum)) + 1 To (4 * (fitnum))
incval = incval + 4
Case Else
End Select
End Function
_________________________________________
This returns nothing but Zero....
What changed in Access 2000 ??
Thanks
Have a check printing routine - where the check register no longer prints correctly (check number no longer increments). The register's check number is based upon the number of lines detail section can handle - 92. A temporary table is created by a SQL command (Access 2000) that calls a function that no longer calculates the check number at all (returns zero). What was changed in Access 2000 that would preclude a piece of earlier code from working?
Here is the SQL Statement_______________________
SELECT DISTINCT Sum(VOUCHERS.VoucherAmount) AS SumOfVoucherAmount, Count(VOUCHERS.VoucherAmount) AS CountOfVouchers, Vouchers.AName, forms!main!unbcheck + increment(CountOfVouchers) AS CheckNum INTO temptable
FROM VOUCHERS LEFT JOIN Attorneys ON VOUCHERS.AName = Attorneys.AName
WHERE (((VOUCHERS.Status)='A'))
GROUP BY VOUCHERS.AName
ORDER BY VOUCHERS.AName;
- unbcheck - is the starting check number,
- increment(CountOfVouchers) is the function that is passed the number of detail lines on the 'checkstub'.
Here is the increment() function ___________________
(that no longer seems to work)
________________________________
Option Explicit
Dim incval As Integer
________________________________
Public Function increment(pvar As Variant) As Integer
Dim fitnum As Integer ' <<<This is the number of vouchers per check page>>>
fitnum = 93
Select Case pvar
Case 1 To fitnum
incval = incval + 1
Case (1 * (fitnum)) + 1 To (2 * (fitnum))
incval = incval + 2
Case (2 * (fitnum)) + 1 To (3 * (fitnum))
incval = incval + 3
Case (3 * (fitnum)) + 1 To (4 * (fitnum))
incval = incval + 4
Case Else
End Select
End Function
_________________________________________
This returns nothing but Zero....
What changed in Access 2000 ??
Thanks