Subform not displaying values from requery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ejamnadas
    New Member
    • Oct 2008
    • 9

    Subform not displaying values from requery

    I have a form which combo boxes (say cmb1 and cmb2). The form also has a subform with a listbox whose rowsource is a query based on the values selected in the comboboxes.

    In the After Update event for cmb2, I put Me.Requery.
    When I select a value in cmb2, the values of the query results do not display in the listbox, but it does so the the correct record count at the bottom of the form, and it shows the correct record count whenever I change the values in the combo boxes.

    I also noticed that when I switch to datasheet view, the correct number of rows display, but they are blank. In each row I can click on a drop down arrow and it will display the all the records of the query (for example, if there were two results, I see two rows each with a drop down arrow each of which show the same two records).

    Thank you for any input
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    You can directly Requery the List Box within the Sub-Form, as in:
    Code:
    Forms![<Form Name>]![<Sub Form Name>].Form![<List Box Name>].Requery

    Comment

    • ejamnadas
      New Member
      • Oct 2008
      • 9

      #3
      Originally posted by ADezii
      You can directly Requery the List Box within the Sub-Form, as in:
      Code:
      Forms![<Form Name>]![<Sub Form Name>].Form![<List Box Name>].Requery
      This worked. Thank you Adezii

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by ejamnadas
        This worked. Thank you Adezii
        You are quite welcome.

        Comment

        Working...