Date/Time Validation for Test Access 2003 Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mango28
    New Member
    • Feb 2008
    • 1

    #1

    Date/Time Validation for Test Access 2003 Database

    Validate the firstActionDate such that it cannot be before DatetoBreackerD ate and cannot be after current date? I did the following but it does not work!?
    Code:
    Private Sub FirstActionDate_BeforeUpdate(Cancel As Integer)
    Rem testing for Me.FirstActionDate can not be after current date
    If Me.FirstAcrionDate <= Date Then
        Cancel = True
       Me.FirstActionDate.SetFocus
       MsgBox "Please enter a date that falls prior to today's date"
    Rem testing for Me.FirstActionDate can not be after DatetoBreaker date
    If Me.FirstAcrionDate < DatetoBreaker Then
        Cancel = True
       Me.FirstActionDate.SetFocus
       MsgBox "Please enter a date that falls prior to first inspection's date"
    End If
    End Sub
    Last edited by NeoPa; Feb 22 '08, 11:04 AM. Reason: [CODE] tags
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Check the spelling of Me.FirstAcrionD ate in your code.
    Have you compiled this code ever?
    I would frankly expect someone to check this sort of thing before posting a question on here.

    Comment

    Working...