Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Refreshing comboboxes in a subform

    Hello all,


    I am new to MS Access. I have a form (e.g. frmA) bound to a table as its Record Source. It has a subform (e.g. subfrmB) inside. The Record Source of the subform is set to a select query which returns multiple results - something like

    select dictinctrow a,b from tableX_JOIN_tableY

    Inside this subform, I have placed a combobox called MyComboBox with its Row Source set to a different query:

    select a,b from tableX

    When I view the form, I see several comboboxes - one combobox for each row returned by the Record Source query of the subform. Here is the problem:

    Sometimes a user would update the database using a web form and he or she will have the Access form open at the same time. This update creates a new record in both tables - tableX_JOIN_tableY and in tableX. Both of the select queries above are supposed to return the new record. When the user opens the Access subform, they expect to see a new combobox with the new record they have just added through the web form. Instead, they see a new blank combobox. The dropdown list of the combobox does not include the new record. The only way to work around this is to close the main form and open it again. Then, the combobox that used to be blank DOES show the new record.

    I was wondering if there is a way to force and update of the combobox dropdown lists. I tried all of this in the "On Current" event of the main form (frmA):

    [Me]![forms]![frmA]![subfrmB]!Requery

    [forms]![frmA]![subfrmB]!Requery

    Me.subfrmB.Requery

    Me.subfrmB.Form.Requery

    Nothing seems to work. Do you have any ideas how to refresh the combobox drop-down lists? Thank you in advance!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Put a Me.ComboBoxName.Requery in the OnEnter or GotFocus event ot the ComboBox. (using your ComboBoxName of course)

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

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2005, 04:52 PM
  2. Subform in a Subform and relationships
    By St3ph3n in forum Database Design
    Replies: 3
    Last Post: 12-06-2005, 06:34 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