Results 1 to 2 of 2
  1. #1
    pervezjan is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2012
    Posts
    12

    Validate Dates

    I have a form Access 2003 and want to validate the dates. Field Name is AdmissionDate and BirthDate. Its not working Please help
    Private Sub BirthDate_BeforeUpdate(Cancel As Integer)
    If dateofadmn <= BirthDate Then
    MsgBox "How Date of Admission is greater than birth date"


    Cancel = ture
    End If
    End Sub

  2. #2
    pervezjan is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2012
    Posts
    12
    Quote Originally Posted by pervezjan View Post
    I have a form Access 2003 and want to validate the dates. Field Name is AdmissionDate and BirthDate. Its not working Please help
    Private Sub BirthDate_BeforeUpdate(Cancel As Integer)
    If dateofadmn <= BirthDate Then
    MsgBox "How Date of Admission is greater than birth date"
    Cancel = ture
    End If
    End Sub
    Thanks
    I solved my problem
    The syntax was wrong I corrected
    Private Sub BirthDate_BeforeUpdate(Cancel As Integer)
    If [BirthDate] >= [DateofAdm] Then
    MsgBox "How Date of Admission is greater than birth date"
    Cancel = True
    End If
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. validate dates with checkboxes
    By princess12 in forum Access
    Replies: 2
    Last Post: 05-14-2015, 11:40 AM
  2. Validate with code Yes or No
    By GinaFlan in forum Forms
    Replies: 10
    Last Post: 10-06-2014, 08:10 PM
  3. Validate textboxes before more VBA
    By cjriebe in forum Programming
    Replies: 3
    Last Post: 06-25-2014, 09:07 AM
  4. Validate a field
    By tweety in forum Forms
    Replies: 19
    Last Post: 03-29-2013, 04:06 PM
  5. validate based on another value
    By subnet11 in forum Programming
    Replies: 3
    Last Post: 06-11-2012, 12:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums