View Single Post
  #2  
Old March 12th, 2010, 03:17 AM posted to microsoft.public.access.tablesdbdesign
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default How do I setup a date field property that allows only Saturdays?

jaymalea wrote:
For example:

03/13/2010 would be fine, as that is a Saturday. 03/12/2010 would return an
error message as it is a Friday.

How would I create a field property for this, or would I use a different
aspect of Access creation?


Private Sub txtSaturday_BeforeUpdate(Cancel As Integer)
If Not Weekday(Me.txtSaturday) = vbSaturday Then
MsgBox "Not a Saturday!"
Cancel = True
End If
End Sub

--
Message posted via http://www.accessmonster.com