Sort by date field

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I am using Windows XP and Access 2000.

I have two tables Tbl-TrainingWaiting and Tbl-TrainingSchedule.

I have a form called Frm-TrainingWaiting which has the table
Tbl-TrainingWaiting as the Record Source.

I use =TRACourse1.Column(1) in the Control Source of a text box to display
the date held in the Tbl-TrainingSchedule table.

I am trying to make the form Frm-TrainingWaiting sort on the date field.

Can this be done?

Thanks you in advance for any help.

Richard
 
Richard said:
I am using Windows XP and Access 2000.

I have two tables Tbl-TrainingWaiting and Tbl-TrainingSchedule.

I have a form called Frm-TrainingWaiting which has the table
Tbl-TrainingWaiting as the Record Source.

I use =TRACourse1.Column(1) in the Control Source of a text box to display
the date held in the Tbl-TrainingSchedule table.

I am trying to make the form Frm-TrainingWaiting sort on the date field.

Can this be done?

Thanks you in advance for any help.

Richard

Can you not add an "Order By" clause to the query that populates the form?
 
Thanks Pvd

The form is based on the Tbl-TrainingWaiting table. If I try to use a query
that joins Tbl-TrainingWaiting and Tbl-TrainingSchedule the form doesn't
allow changes. Which I need to be able to do.

But, because I am not joining the two tables in a query, I'm guessing I
can't reference the date field in Tbl-TrainingShedule table to use in OrderBy.

Richard
 
Sorry. I've tried using Order By in the SQL as well. It doesn't work.

SELECT [Tbl-Schedule].Course, [Tbl-Schedule].CourseID,
[Tbl-Schedule].MainDate, [Tbl-Schedule].StartTime, [Tbl-Schedule].EndTime,
[Tbl-Schedule].Trainer, [Tbl-Schedule].Duration, [Tbl-Schedule].Room,
[Tbl-Schedule].Hold FROM [Tbl-Schedule] WHERE [Tbl-Schedule].MainDate>Now()-1
ORDER BY [Tbl-Schedule].MainDate DESC;
 
Back
Top