mloucel
Member
- Local time
- Today, 00:13
- Joined
- Aug 5, 2020
- Messages
- 356
I have this little piece of code that for some weird reason today [FRIDAY] it doesn't work
If I get rid of the "or" then it works perfectly, but I must check for Friday and Saturday to be able to close the database and do backups.
What am I doing wrong?
Code:
Dim ActualTime As Date
ActualTime = TimeValue(Now())
If WeekdayName(Weekday(Date)) = "Friday" _
Or _
WeekdayName(Weekday(Date)) = "Saturday" _
And _
ActualTime > #6:30:00 PM# Then
DoCmd.Close acForm, "frmLogin", acSaveNo
DoCmd.OpenForm "frmNOOPEN"
Exit Sub
End If
If I get rid of the "or" then it works perfectly, but I must check for Friday and Saturday to be able to close the database and do backups.
What am I doing wrong?