If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Question about Date validation
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 |
#2
|
|||
|
|||
Question about Date validation
Use the WeekDay function
If WeekDay(Me.DateField) = 6 Then MsgBox "Error" End If -- Good Luck BS"D "NoviceNana" wrote: 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 |
#3
|
|||
|
|||
Question about Date validation
On Mar 15, 3:57 pm, Ofer Cohen
wrote: Use the WeekDay function If WeekDay(Me.DateField) = 6 Then MsgBox "Error" End If -- Good Luck BS"D "NoviceNana" wrote: 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- Hide quoted text - - Show quoted text - Excellent! Thanks so much! |
#4
|
|||
|
|||
Question about Date validation
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 -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000 Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|