Multiple Actions on Sub

fenhow

Registered User.
Local time
Today, 12:53
Joined
Jul 21, 2004
Messages
599
Hi, I have this sub:

Private Sub PaidDate_AfterUpdate()
If [PaidDate] > [DueDate] + 3 Then
[LateFee] = [AmountDue] * 0.1
ElseIf [PaidDate] = [DueDate] Then
[LateFee] = "0"
End If
End Sub


If I wanted to apply another action such as:

If [PaidDate] = [DueDate] or [DueDate] + 3 Then
[Deliquent] = "No"

How would I go about that?
Thanks.
Fen
 
Code:
 [COLOR=#0000ff]Private Sub PaidDate_AfterUpdate()
    If [PaidDate] > [DueDate] + 3 Then
          [LateFee] = [AmountDue] * 0.1
    ElseIf [PaidDate] = [DueDate] Then
          [LateFee] = "0"[/COLOR]
 [COLOR=#0000ff]          [Delinquent] = "No"[/COLOR]
 [COLOR=#0000ff]    elseif [PaidDate] = [DueDate] + 3 Then[/COLOR]
 [COLOR=#0000ff]          [LateFee] = "0"
 [COLOR=#0000ff]          [Delinquent] = "No"[/COLOR]
    End If
End Sub[/COLOR]
You could combine the second two 'If' statements, but separating them out will allow you to add different commands, to each should these prove necessary, in the future.
 
You would just add that (using valid syntax) after the End If of the first If/Then block. Or if the logic is appropriate, as another ElseIf. Or, if one of the existing tests does what you want, add a line setting the value to the existing code. I'm not clear on what you're trying to do.
 
Oops, slow brain plus slow fingers equals late post. :p
 

Users who are viewing this thread

Back
Top Bottom