Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    11

    Date Validation in Forms and subforms!

    Can anyone help?

    I am trying to create a form where the date in the subform, called
    Date Attended, cannot be earlier than the Employment Date in the main form.

    (Date Attended is a sub form contained within the main form. The main part of the form has a field called Employment date.)

    I think the way to do this is to use the before update box in the event area of the properties of the Date Attended field. The thing is, when I put validation in the expression builder it does not work.



    I suspect some sort of IF statement may be required.

    Surely this is not that complex a job???

    Does anyone have any thoughts or tips regarding how to do this???

    Thanks

    Arrrggggjhhhhhhh!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Show your code for analysis.

    Could try the Validation Rule property of the textbox.

    >= Forms![mainformname]![Employment Date] Or Is Null
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jan 2012
    Posts
    11

    It Worked!!

    Nice one.

    I tried it and it worked.
    I've been trying for days to get this to work in all sorts of ways so this is a result.
    I think I was looking for something more complicated than it was (e.g. IF statements etc)

    Thanks


  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The Validation Rule property won't work for all situations but should serve for most. Sometimes VBA will be needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Controls in forms and subforms
    By donnan33 in forum Access
    Replies: 2
    Last Post: 01-05-2012, 10:29 AM
  2. Replies: 5
    Last Post: 10-27-2011, 01:00 PM
  3. forms and subforms
    By phineas629 in forum Forms
    Replies: 4
    Last Post: 10-05-2011, 02:46 PM
  4. Forms and Subforms Problem
    By desibabu90 in forum Forms
    Replies: 33
    Last Post: 07-19-2011, 10:48 AM
  5. Help with Forms and Subforms
    By xstaceyid in forum Forms
    Replies: 1
    Last Post: 04-21-2011, 02:14 PM

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