Hi All,
I'm working on a form for weekly data entry. I'd like to create a
date field where the user will enter the date the week ends (ie week
ending Friday, June 25th). Is there a way to write code so that
Access will check that the day the user inputs is a Friday (and if not
they will recieve an error message)?. I know how to program the
error message pop-up box, but I have no idea how to write code to
check if the date inputted is a Friday.
Any help would be greatly appreciated!
Thanks
Ofer Cohen - 15 Mar 2007 20:57 GMT
Use the WeekDay function
If WeekDay(Me.DateField) = 6 Then
MsgBox "Error"
End If

Signature
Good Luck
BS"D
> Hi All,
>
[quoted text clipped - 8 lines]
> Any help would be greatly appreciated!
> Thanks
pokuaa.mensah@gmail.com - 15 Mar 2007 22:19 GMT
On Mar 15, 3:57 pm, Ofer Cohen <OferCo...@discussions.microsoft.com>
wrote:
> Use the WeekDay function
>
[quoted text clipped - 19 lines]
>
> - Show quoted text -
Excellent! Thanks so much!
missinglinq - 16 Mar 2007 03:07 GMT
Since you want to throw an error message if the date IS NOT a Friday,
shouldn't it be
If WeekDay(Me.DateField) <> 6 Then
MsgBox "Error"
End If

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000