Advertisement

07.23.2008 at 06:57AM PDT, ID: 23588470
[x]
Attachment Details

ACCESS VBA DATE IS BETWEEN

Asked by DomiLama in Access Coding/Macros

Tags: Microsoft, Access, 2000, Access VBA

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_Date 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 IfStart Free Trial
[+][-]07.23.2008 at 07:07AM PDT, ID: 22069426

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Access Coding/Macros
Tags: Microsoft, Access, 2000, Access VBA
Sign Up Now!
Solution Provided By: RgGray3
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.23.2008 at 07:10AM PDT, ID: 22069463

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:36AM PDT, ID: 22069726

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:36AM PDT, ID: 22069732

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 09:52AM PDT, ID: 22071211

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628