G
Guest
I have a function to calculate a contract's ending date. Instead of basing
it on the contract's start date, I need to compare 2 dates (acceptance_date
or contract_start_date) and use only the greater of the 2 dates. Can you use
an "if" statement within a function? I am doing something terribly wrong.
Here is my function:
Public Function CalcEndDate (optionframe as integer, term as integer, start
as date)
Select Case optionframe
Case 1
CalcEndDate = DateAdd("m",term,start)-1
Case 2
CalcEndDate = DateAdd("ww",term,start)
End Select
End Function
Private Sub Acceptance_date_Change( )
If Not IsNull(optChoose) and Not IsNull(Term_mos) and Not
IsNull(acceptance_date) Then
If Acceptance_date < Contract_start_date
Acceptance_date = contract_start_date
Else
Acceptance_date = Acceptance_date
End If
Me!contract_end_date = CalcEndDate)[optChoose],[term_mos],[Acceptance_date]
End Sub
Thank you in advance for your help!
it on the contract's start date, I need to compare 2 dates (acceptance_date
or contract_start_date) and use only the greater of the 2 dates. Can you use
an "if" statement within a function? I am doing something terribly wrong.
Here is my function:
Public Function CalcEndDate (optionframe as integer, term as integer, start
as date)
Select Case optionframe
Case 1
CalcEndDate = DateAdd("m",term,start)-1
Case 2
CalcEndDate = DateAdd("ww",term,start)
End Select
End Function
Private Sub Acceptance_date_Change( )
If Not IsNull(optChoose) and Not IsNull(Term_mos) and Not
IsNull(acceptance_date) Then
If Acceptance_date < Contract_start_date
Acceptance_date = contract_start_date
Else
Acceptance_date = Acceptance_date
End If
Me!contract_end_date = CalcEndDate)[optChoose],[term_mos],[Acceptance_date]
End Sub
Thank you in advance for your help!