Results 1 to 2 of 2
  1. #1
    jle0003 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    60

    Condition main form control based on multiple records in subform

    I have an 2007 Access database that contains a mainform (frmEvent) and a subform (sfrmComment). Each Event has multiple comments and each comment has an individual status (Open, In work, Closed). There is an overall Event "Closed" checkbox that if True the Event is closed. I want this checkbox to auto-check when all of the comment statuses are set to "Closed". I have attached a sample db. Can someone help me out with the code please?

    Thanks for your help!!


    Jamie
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The EventStatus field is a calculated value dependent on other data in another table. Saving dependent calculated data is usually a bad idea. There is no real need to save this to table, it can be calculated when needed.

    Status: IIf(Not IsNull(DLookup("CommentStatus", "tblComment", "CommentStatus='Open'")), "Open", "Closed")


    However, saving the value requires VBA code. The real trick is figuring out what event to put the code in.
    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. Replies: 4
    Last Post: 07-11-2012, 10:31 AM
  2. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  3. Replies: 18
    Last Post: 01-27-2012, 12:53 PM
  4. Replies: 3
    Last Post: 12-01-2011, 06:51 AM
  5. Replies: 0
    Last Post: 06-23-2009, 03:01 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