Sorting records in a subform

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I have a form with a subform (subform based on a query).
I am looking for code that can sort the records in the
subform by clicking on a command button.

Thanks,

Gary.
 
Gary said:
I have a form with a subform (subform based on a query).
I am looking for code that can sort the records in the
subform by clicking on a command button.


If the buttom in on the main form:

Me.subformcontrol.Form.OrderBy = "nameoffield"
Me.subformcontrol.Form.OrderByOn = True

If the button is in the subform:

Me.OrderBy = "nameoffield"
Me.OrderByOn = True
 
Back
Top