Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Refresh (2003 SP2)

    I have a combo box on a sub-form with the criteria referring to a field on the parent form. When I change records on the parent form, the combo will not refresh automatically. I've tried 'me.refresh' on the on-click event for the combo, plus recalc and requery but nothing works automatically. If I press F9 then it refreshes but I can't keep doing that everytime.

    Any ideas please?
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Refresh (2003 SP2)

    Me.Refresh won't help - it updates the records in the subform, but not the row source of the combo box. You need to requery the combo box, you could do this in the On Current event of the main form:

    Private Sub Form_Current()
    Me.SubFormName.ComboBoxName.Requery
    End Sub

    where SubFormName is the name of the subform as a control on the main form, and ComboBoxName is the name of the combo box. If either of these names contains a space or punctuation, enclose the name in square brackets [ ].

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Refresh (2003 SP2)

    Thanks Hans - works perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •