Sorting subforms

C

ChrisK

I am a complete beginner at using Access and have been setting up a database
for keeping details of customers, machines and jobs. I have managed to get
it looking something like I want but have now got stuck so hope someone can
help me.

I have a main form contaning customer contact details. In this is a subform
with machines which the customer has on site and within that is another
subform (in continuous form view) where I enter details of jobs carried out
on each machine. This works well in that when I select a customer I see only
the machines which that particular customer has and selecting a machine then
shows me jobs recently carried out as well as letting me enter a new job.
However I can't get this sorted by date and it seems to be quire random in
order.
If I set the property of subform to Order By date then when main form is
opened I get error saying "You must use the same number of fields when you
set the LinkChildFields and LinkMasterFields properties".
If, instead of having the Record Source as the related table, I use the
Query Bbuilder to select and sort by date field, I get listed in the subform
all jobs not just those related to the selected customer and machine.

I hope that I have made it clear what I am trying to do and would appreciate
any help or advice.

ChrisK
 
J

Jeff Boyce

Chris

Go to the form you are using as the sub(?sub)form. Open it in design mode.
Take a look at what you're using as a source. If it isn't a query, based on
the underlying table, make it a query, based on the underlying table. Sort
the query.

Your sub(?sub)form should now show (sorted) data.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

ChrisK

Jeff,

That's done the trick though it seems a bit of a complicated way of going
around things. I guess that's just one of many quirks of Access which I am
learning about.

Thanks for the help.

ChrisK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top