Ordering Records in a Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I created a query based on three related tables: A,B, and C. All in a one to many relationship A to B to C.
I created a form based on this query and combined the fields from A and B (via the wizard) into the main form and the subform is table C.
I wish to order my records by a certain field in table C for that subform. But using the OrderBy property for the subform doesn't result in the desired order. The record source is based on the table C (which suprised me since I created the form based on a query for all three tables) but anyway ... any help in the right direction would be appreciated.

Thanks.

djb
 
You dont need a combined query of A,B,C to do this. Just combine the A and
B tables if you need to for the main form. Base the subform on a query
using table C, and make sure you include the field linking it to the primary
key used from tables A,B. Set the order in the query to whatever you need.
Then the subform will use that order for display.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
djb said:
Hi,

I created a query based on three related tables: A,B, and C. All in a one
to many relationship A to B to C.
I created a form based on this query and combined the fields from A and B
(via the wizard) into the main form and the subform is table C.
I wish to order my records by a certain field in table C for that subform.
But using the OrderBy property for the subform doesn't result in the desired
order. The record source is based on the table C (which suprised me since I
created the form based on a query for all three tables) but anyway ... any
help in the right direction would be appreciated.
 
Did you remember to set OrderByOn to true?

The simplest solution would be to create a separate query into table C, so
you can specify the sort order in the query.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

djb said:
I created a query based on three related tables: A,B, and C. All in a one
to many relationship A to B to C.
I created a form based on this query and combined the fields from A and B
(via the wizard) into the main form and the subform is table C.
I wish to order my records by a certain field in table C for that subform.
But using the OrderBy property for the subform doesn't result in the desired
order. The record source is based on the table C (which suprised me since I
created the form based on a query for all three tables) but anyway ... any
help in the right direction would be appreciated.
 
Back
Top