VBA Date problem

sam1fletcher

Registered User.
Local time
Today, 01:03
Joined
Jan 28, 2013
Messages
40
hi all

the code i have works for every other month of the the year but not for feburary.

the code is simple :: if within 2 dates then edit the recordset.

Code:
If Sdate > #2/1/2014# And Sdate < #2/30/2014# Then
.Edit
!feb2 = !feb2 + Amount
.Update
End If
If Pdate > #2/1/2014# And Pdate < #2/30/2014# Then
.Edit
!feb4 = !feb4 + Amount
.Update
End If

for some reason the 2 if statement lines bring up a compile error, syntax

anyone know the resons
 
Sam, I do not think February has the day 30 in any of the Calender year..
Code:
If Sdate > #2/1/2014# And Sdate < [COLOR=Red][B]#2/30/2014#[/B][/COLOR] Then
    .Edit
    !feb2 = !feb2 + Amount
    .Update
End If
If Pdate > #2/1/2014# And Pdate < [COLOR=Red][B]#2/30/2014#[/B][/COLOR] Then
    .Edit
    !feb4 = !feb4 + Amount
    .Update
End If
 
What a nob i am thanks

sam
 
It seems odd that you are omitting the first of the month.

Brian
 

Users who are viewing this thread

Back
Top Bottom