Results 1 to 2 of 2
  1. #1
    Xterra14s is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    32

    Is it possible to have a value from a main form auto fill into a subform? **Pictures below**

    I inserted a picture in hopes of making it easier.


    What I want to do is have the number I type in in section 1 automatically appear in section 2. The way I currently have it it does work but now properly. I have set field 2 to show field 1 as the default value but it wont update when refreshing. I have to click between tabs in order for it to do so. Is there a VBA code or something that will let me do this?

    Attachment 25344

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try setting subform Field 2 in the after update event of main form Field 1:

    forms![MainFormName]![SubformContainerName].form![Field2] = forms![MainFormName]![Field1]

    Or, using Me! to refer to the main form:

    Me![SubformContainerName].form![Field2] = Me![Field1]

    If you want the Subform field to be refreshed each time you move to a new record on the main form, put that code in the main form's On Current event as well.

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

Similar Threads

  1. Replies: 6
    Last Post: 08-17-2015, 10:52 AM
  2. Fill field in subform with main form ID
    By bkaren1203 in forum Forms
    Replies: 1
    Last Post: 09-01-2014, 11:01 AM
  3. Replies: 2
    Last Post: 03-21-2014, 10:40 AM
  4. Auto Fill a form
    By Suzemt in forum Access
    Replies: 3
    Last Post: 02-18-2013, 11:20 AM
  5. Replies: 3
    Last Post: 01-18-2012, 03:05 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