Results 1 to 6 of 6
  1. #1
    Aboys77 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    2

    Combo box in sub forms not updating with parent form

    I have a parent form with a combo box to search records. Within the parent is the 1st sub form. There is also a second sub form within the 1st sub form.
    When select a record on the parent form, the sub form combo boxes do not update with the main form.
    I can get this working if I use refresh all, or use the refresh command on "got focus" event. The only problem with this is you need to establish focus first then click combo box for it to update. All the sub forms have been linked with child and master fields. Not sure sure what I could be missing to fix this problem.

    Any help would be appreciated.

    Thanks

  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,822
    First, is the combobox used to select/enter search criteria unbound?

    Exactly what in the subform comboboxes is not updating - RowSource list? Do the comboboxes have conditional SQL as RowSource? If a conditional SQL, try code in the subform OnCurrent event to requery the comboboxes.
    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
    Aboys77 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    2
    I believe the combo box is bound, seeing as the record source for the form and the combo box are the same. However I've changed the SQL statement where condition. It is displaying records that match only with what record ID is selected from the parent form. I tried putting the requery on the subform oncurrent event and I get error 3021 and the message stating it cant find named field "My Combo Box Name".

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you post the SQL? And give a description of what you want to accomplish?
    You could even post a copy of your database with instructions of how to see the issue you are having.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Combobox is bound if it has a ControlSource that references field. Makes no sense to filter main form combobox to same record as the main form.

    Suggestion is to use subform OnCurrent event to requery the subform comboboxes, as well as requery code in each combobox GotFocus event. And use your combobox names in place of 'My Combo Box Name'. Are comboboxes on subform used for data entry?

    If you want to provide db, follow instructions at bottom of my post.
    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.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Isn't this just a matter of requerying the subforms when the main form combo box is updated? Or at least ensuring the main form is requeried so that the linked fields can update?
    It would be a bit trickier to get a subform on a subform to requery methinks - I've never nested subforms. I'd bet the syntax for sub-sub form access has been posted many times though.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-26-2014, 06:05 PM
  2. Replies: 1
    Last Post: 09-03-2014, 01:36 PM
  3. Replies: 3
    Last Post: 07-03-2013, 01:20 PM
  4. Subform with multiple parent forms
    By mwc0914 in forum Forms
    Replies: 8
    Last Post: 03-12-2013, 06:17 AM
  5. combo not updating form
    By cjamps in forum Forms
    Replies: 5
    Last Post: 04-14-2009, 12:00 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