Ordering Detail Records by Date in a Subform not Working

  • Thread starter Thread starter Tom \T\
  • Start date Start date
T

Tom \T\

I have a form, frmDataEntry, that contains LName, FName, MI, and Comments as
its Main section. frmDataEntry also has contained within it a subform which
contains transactions for that individual in a DataSheet view: What, Where,
Date, How Much, and Quantity.

I want to sort the transactions, by Date, for that individual. The Main
section of the form is based on tblMain and the subform for the transactions
is based on tblTransactions.

tblTransactions has the primary key for tblMain as its foreign key as well
as its own primary key (autonumber field). On the subform properties... Data
Tab... "Order By" field I entered the tblTransactions.TraDate to sort
ascending however it is sorting on its primary key field for tblTransactions
and not the Date field. I know from searching the internet that you can base
the form on a query but I would rather do it within the form using code if
necessary. Can anyone help?

- Tom
 
Tom said:
I have a form, frmDataEntry, that contains LName, FName, MI, and Comments as
its Main section. frmDataEntry also has contained within it a subform which
contains transactions for that individual in a DataSheet view: What, Where,
Date, How Much, and Quantity.

I want to sort the transactions, by Date, for that individual. The Main
section of the form is based on tblMain and the subform for the transactions
is based on tblTransactions.

tblTransactions has the primary key for tblMain as its foreign key as well
as its own primary key (autonumber field). On the subform properties... Data
Tab... "Order By" field I entered the tblTransactions.TraDate to sort
ascending however it is sorting on its primary key field for tblTransactions
and not the Date field. I know from searching the internet that you can base
the form on a query but I would rather do it within the form using code if
necessary.


It is best to use the query approach.

If you feel you must use the OrderBy property, don't forget
to also set the OrderByOn property to True.
 
Back
Top