Results 1 to 5 of 5
  1. #1
    cballew is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    May 2018
    Posts
    10

    Subform Issues

    So I have a form users are brought to when they log in and on that form I have a subform that is all assignedcalls for that user. It pulls fine but it doesn't when they first load the page. If I add a button to requery it works just fine. I think it has to do with the fact that when they log in I'm feeding their username to a text field on their nav page and that username is required for the query for the subform. Is there a way to set the requery macro to occur after the username has been fed over. I thought it would have been an onload event but that doesn't seem to work. I guess it really would need to be after everything including the subform had rendered, but I don't know what event that would be (afterrender didn't seem to work either though I am unfamiliar with that event type).



    Thanks for any help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,895
    Is the main form bound and you apply filter?

    Be aware subforms load before mainform (I know, weird but true). Master/Child links properties of subform container control manage the synchronization of related records. If there is no relationship between main and sub form, why use this arrangement? Not saying inappropriate (I have done this) just wonder if it is really necessary.

    You use macro, not VBA? I only use VBA.
    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
    Gicu's Avatar
    Gicu is online now VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,111
    Have you tried to requery the subform in the AfterUpdate event of the username textbox (something like Forms![YourFormName].sfrmControlName.Form.Requery)?

    Cheers,
    Vlad

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,895
    Control AfterUpdate won't trigger when field/control populated by code.

    Did you try code to requery subform in main form Load event?
    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.

  5. #5
    Gicu's Avatar
    Gicu is online now VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,111
    Do you keep your login form open (hidden) or do you store the username in a tempvar or any other place (like local settings table)?
    If yes change the recordsource of the subform to point to that instead of the username textbox of its parent form.

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

Similar Threads

  1. Subform issues
    By Accu-Grind in forum Forms
    Replies: 2
    Last Post: 07-06-2015, 02:22 PM
  2. Replies: 12
    Last Post: 06-11-2015, 02:24 PM
  3. Subform Issues
    By beaverx37 in forum Forms
    Replies: 8
    Last Post: 03-03-2015, 01:33 PM
  4. Subform issues
    By spqr in forum Forms
    Replies: 3
    Last Post: 10-14-2013, 08:53 AM
  5. Subform Issues
    By dromorkid in forum Forms
    Replies: 0
    Last Post: 11-24-2008, 11:35 AM

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