View Full Version : Order by in a subform


AnnaFoot
06-14-2001, 03:20 AM
I have a subform, displaying in datasheet mode, within a form that has no record source. I can't seem to control the order in which the records are displayed in the subform. When the subform is opened alone, not within the parent form, the order by command is adhered to, but it reverts back to the order they were entered when the subform is entered in the main form. Any ideas? Thanks Anna

D-Fresh
06-14-2001, 04:47 AM
I'm not sure how you're setting the Order By property, but you should do it in the On Open event of the subform. Key in the following to the On Open event of the subform:

me.OrderBy = "[SortField]"
me.OrderByOn = True

Hope that helps.

Doug