Results 1 to 10 of 10
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318

    Subform field needs main form refresh to load.

    I have a calculated sub - subform field named "Replacement" that should popluate when data is entered into the field "DateInstalled". The only way it populates is when I refresh the main form. I tried to do an After Update on the DateInstalled field to refresh the main form but do not know the right code to use. Please let me know what code would do this. The main form is named "Fm_Inventory".

  2. #2
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    It sounds like you might be trying to refresh the main form from code in the subform. If so, try:

    Me.Parent.Requery or Me.Parent.Refresh

  3. #3
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    This seems to work but it puts the focus on the main form after the refresh. How do I keep the focus on the subform.

  4. #4
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    put this line after to requery/refresh and substitute the name of a control on the subform for "controlname"

    me.controlname.setfocus

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The Requery method will cause the entire recordset to be re-queried and move your current record to the beginning of the recordset. If this is not acceptable, you may need to employ DAO and the Bookmark method.

  6. #6
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    That didn't work. How do you do the DAO and Bookmark method?

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Huddle View Post
    That didn't work...
    What did not work?

  8. #8
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    me.controlname.setfocus

  9. #9
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    substitute your control name for "controlname". what did your code look like?

  10. #10
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    Me.Parent.Requery
    Me.LastTested.SetFocus

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

Similar Threads

  1. Replies: 17
    Last Post: 08-22-2013, 08:22 AM
  2. Replies: 6
    Last Post: 08-24-2012, 12:04 PM
  3. Subform Refresh in a Tabbed Main Form
    By theosgood in forum Forms
    Replies: 5
    Last Post: 06-22-2012, 10:12 AM
  4. Replies: 4
    Last Post: 03-14-2012, 10:08 AM
  5. Replies: 9
    Last Post: 12-15-2010, 01:44 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