If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to order in subforms
Hi all,
I have a database of 200+ students. Most of their details are shown on their main form. However I also need to show within this form the details of any absences from placements they attend. The main table for the students has an autonumber for the primary key as does the table for the absences. I couldn't use either the student ID or the date in this table as the primary key as both need to be duplicated. I entered the absence table into the main student form as a subform and all works well, it display all of the data that is needed. The only problem is that the subform insists on displaying the its data in order of its primary key, the autonumber. I would like it to be displayed in date order, but just seem to be running around in circles with it. I did try a query with all data from the absence table, then sorted it for the date and tried basing the subform on that. It was entered ok, but still in order of the primary key. Am I missing something really basic? If so, be gentle with your answers, I'm still learning. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200704/1 |
#2
|
|||
|
|||
How to order in subforms
Create a query for your subform and sort data in the table by date order,
eg. qryAbsence: SELECT Absence.* from Absence ORDER BY Absence.YourDateField. In your subform set DataSource: qryAbsence It should do what you need. If not... don't kill me, pls... ;-) Vlado "Tazzy via AccessMonster.com" u26845@uwe pÃ*Å¡e v diskusnÃ*m pÅ™Ã*spÄ›vku news:701dae1eeaea2@uwe... Hi all, I have a database of 200+ students. Most of their details are shown on their main form. However I also need to show within this form the details of any absences from placements they attend. The main table for the students has an autonumber for the primary key as does the table for the absences. I couldn't use either the student ID or the date in this table as the primary key as both need to be duplicated. I entered the absence table into the main student form as a subform and all works well, it display all of the data that is needed. The only problem is that the subform insists on displaying the its data in order of its primary key, the autonumber. I would like it to be displayed in date order, but just seem to be running around in circles with it. I did try a query with all data from the absence table, then sorted it for the date and tried basing the subform on that. It was entered ok, but still in order of the primary key. Am I missing something really basic? If so, be gentle with your answers, I'm still learning. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200704/1 |
#3
|
|||
|
|||
How to order in subforms
Hi VladimÃ*r
Funny how when I tried that at first it didn't work, but on repeating it worked fine. Must have missed something in the first place. Thanks for your help.........you will survive Tazzy -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200704/1 |
Thread Tools | |
Display Modes | |
|
|