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 Programming / July 2007

Tip: Looking for answers? Try searching our database.

Day Validation code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rama - 17 Jul 2007 15:24 GMT
Hello,

I am looking for some help for my data entry form. In the form there
is a combo box, which is used to enter date ("cboLongDate"). The date
format is "Wednesday, June 13, 2007" . I need to confirm the day is
Wednesday or not before the user click on add data or close form. The
important thing is day (ie "Wednesday") not the date as Wednesday
comes every week. If the selected day is not "wednesday" a message box
should pop up saying the day selected is incorrect while closing or
adding data so that user can get a chance to correct it.
Thanks in advance
Rama
Allen Browne - 17 Jul 2007 15:33 GMT
Use the BeforeUpdate event procedure of the combo.

Test if WeekDay([cboLongDate]) is 4.

Cancel the event if you want to force the user to enter a different value.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hello,
>
[quoted text clipped - 8 lines]
> Thanks in advance
> Rama
 
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.