Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Question about Date validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NoviceNana - 15 Mar 2007 20:20 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.