Hello experts, I've created a VBA function (below) that is giving me a complie error "sub or function is not defined". Could someone tell me where I might be going wrong or suggest a better way.
Background:
I want to update the PERIOD_ID field in the TBL_APPOINTMENT_DETAILS table to the value in ROW_ID in the TBL_REPORTING_PERIOD table.
TBL_APPOINTMENT_DETAILS:
EMP_NO CHANGE_DATE PERIOD_ROW_ID
33259VA 02/04/2008 *This should be 526
33259VA 17/05/2008 *This should be 526
33259VA 09/06/2008 *This should be 526
TBL_REPORTING_PERIOD:
ROW_ID TAX_YEAR QUARTER PERIOD DATE_FROM DATE_TO
526 08/09 1 1 01/04/2008 30/04/2008
527 08/09 1 2 01/05/2008 31/05/2008
528 08/09 1 3 01/06/2008 30/06/2008
--------------------------
-----
Function REPORTING_PERIOD(Change_Da
te As Date, DFrom As Date, DTo As Date, PERIOD_ID As Integer)
If Change_Date Is between(DFrom And DTo) Then
REPORTING_PERIOD = PERIOD
Else
REPORTING_PERIOD = 0
End If
Start Free Trial