Sort by date field

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
 
P

PvdG42

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?
 
R

Richard

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
 
R

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;
 

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

Similar Threads


Top