• updating query (xp)

    • This topic has 9 replies, 2 voices, and was last updated 17 years ago.
    Author
    Topic
    #450957

    I have a drop down in a table which is base on a query. Then on a form I have a subform with this table.
    When I open the record the query works fine but when I switcg records the query is still showing the info from the first record.

    I think it has something to do with the dirty event. I am guessing this should be set so when I open the tab but how is the question.

    Viewing 0 reply threads
    Author
    Replies
    • #1109080

      Is this in any way related to your previous question with the same subject?

      • #1109083

        Nope… That one is figured out. This is a different one where it works the fist time I try to use the drop dows but when I change records the drop downs still have the same info…. the drop downs are built off of querys.

        • #1109085

          You haven’t provided enough information.

          • #1109089

            Sorry,

            form with tabs on one tab is a subform
            subfom has drop downs which arew linked to querys

            when I open record 1 the dropdown has the information for record 1
            when I change to record 2 the dropdown still have the info for record 1
            if I close the form and opened it again and go to record 2 before I go to the subform I get the dropdown for the 2nd record

            it is like the subform is not getting the changes when the record changes. I was guessing this had something to do with the dirty command…

            • #1109090

              You should requery the combo boxes in the On Current event of the subform.

            • #1109091

              How would I do that…

            • #1109093

              Something like

              Private Sub Form_Current()
              Me.ComboBox1.Requery
              Me.ComboBox2.Requery
              End Sub

              where ComboBox1 and ComboBox2 are the names of the combo boxes (dropdowns). You can add/remove lines as needed for your situation.

            • #1109094

              This will go where… on the VB for the subform?

            • #1109095

              Yes, since you want to requery combo boxes on the subform, you should use the On Current event of the subform. The code for the On Current event of the subform belongs in the code module of the subform.

    Viewing 0 reply threads
    Reply To: updating query (xp)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: