Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Order By Property in Form doesn't work (2000)

    Hi!

    I have a form with a subform. I added a filter to my form using a combo box. When I change the record in the combo box, it brings up the correct record in the subform, but I have one problem. The subform is set up in Properties-Order By to sort by one field. It doesn't work when I choose a record using the combo box.

    I did try to put a Requery in the combo box code, but that didn't solve my problem. The code that I have in the combo box is:

    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[ResolutionID] = " & Str(Me![Combo42])
    Me.Bookmark = rs.Bookmark

    Me.[Rooster and Vote].Form.Requery

    Help! Why isn't it working now? And what can I do to get around this problem?

    Thanks so much for your time!

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

    Re: Order By Property in Form doesn't work (2000)

    Bringing democracy to roosters?

    If possible, set the record source of the subform to a query that is ordered by the field you want to sort on. That way, the subform should stay sorted when you move to a different record in the main form.

    If that isn't possible, try the following instead of Me.[Rooster and Vote].Form.Requery:

    With Me.[Rooster and Vote].Form
    .OrderBy = "fieldname" ' replace with name of field to sort on
    .OrderByOn = True
    End With

  3. #3
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order By Property in Form doesn't work (2000)

    Thanks! It worked! You are all so helpful and I am learning so much with your help!

Posting Permissions

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