Results 1 to 2 of 2
  1. #1
    bkaren1203 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    2

    Fill field in subform with main form ID


    Hopefully I can explain what I'm trying to do correctly. I have a main form Orgs and a subform Acts. They are linked by the field OrgID. The subform Acts is displayed as a datasheet. I found some code that would allow the user to click on the ActID in the subform and the Activities form will pop up for the ActID clicked on. The user can also click on "New" to pull up a blank Activities form. When I close the Activities form, the new record doesn't appear in the subform Acts on the main form Orgs. Which means that the new Activities record field OrgID is blank. So, how do I get the Activities field OrgID populated with the OrgID from the main table so that the new Activities record is linked to the OrgID field the main table?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Have to requery the Acts subform. Couple ways to accomplish.

    1. open the Activities form with acDialog parameter to suspend code execution by the Acts subform until Activities closes, then the next line would be:
    Me.Requery

    2. code in Activities form Close event requeries the Acts subform
    Forms!Orgs!Acts.Requery

    I prefer option 1.
    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: 2
    Last Post: 03-21-2014, 10:40 AM
  2. Replies: 3
    Last Post: 01-18-2012, 03:05 AM
  3. Replies: 9
    Last Post: 12-15-2010, 01:44 PM
  4. Replies: 1
    Last Post: 11-13-2010, 12:57 PM
  5. Replies: 3
    Last Post: 11-05-2010, 03:10 PM

Tags for this Thread

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