Sorting in subform

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

You could base the main form and the subform on queries that use the ORDER
BY phrase:

main form:
SELECT * FROM MainTable ORDER BY Field123

subform:
SELECT * FROM SubTable ORDER BY Field456

HTH,
TC
 
... Any help or suggestions, please
I am trying to sort a subform when opened in a main
form. Both the underlying table and the subform sorts
OK, but when opened in the main form the sort is not
applied. I can select the column and sort from the
toolbar while opened from the main form, but the sort is
not saved. The subform is shown in datasheet mode.
 
I am trying to sort a subform when opened in a main
form. Both the underlying table and the subform sorts
OK, but when opened in the main form the sort is not
applied. I can select the column and sort from the
toolbar while opened from the main form, but the sort is
not saved. The subform is shown in datasheet mode.

Have you tried adding an ORDER BY statement to the Record
Source of the subform? For example,

SELECT tblOrders.*
FROM tblOrders
ORDER BY tblOrders.OrderNumber;

If your subform is based on a table, try basing it on a
query instead. Then, make your sort preferences in the
query, save the query, and the subform data should
respond accordingly.

Kurt
 
Back
Top