Thanks Allen!
I'm getting so confused. I'm not making any progress at all. If you
(or anyone) wants to help, please look at the SQL statement for my
Form, and then maybe you will see why I'm having a problem. Keep in
mind that everything works "perfectly", except that I want to sort by
the Airport Name (From and To), and not their ID's. Thanks for any
help you can provide...
SELECT tblFlightSchedule.FltNum, tblAirports.Airport,
tblAirports_1.Airport, tblFlightSchedule.FromAirport,
tblFlightSchedule.ToAirport, tblAirlines.txtAirline,
tblFlightSchedule.Via, tblFlightSchedule.DepartTime,
tblFlightSchedule.ArrivalTime, tblAirports.TimeZone,
tblAirports_1.TimeZone, [tblAirports.TimeZone] AS FromA,
[tblAirports_1.TimeZone] AS ToA,
IIf([FromA]="Hawaii",1,IIf([FromA]="Alaska",2,IIf([FromA]="Pacific",3,IIf([FromA]="Mountain",4,IIf([FromA]="Central",5,IIf([FromA]="Eastern",6))))))
AS DTimeFactor,
IIf([ToA]="Hawaii",1,IIf([ToA]="Alaska",2,IIf([ToA]="Pacific",3,IIf([ToA]="Mountain",4,IIf([ToA]="Central",5,IIf([ToA]="Eastern",6))))))
AS RTimeFactor,
CVDate(Nz(DateAdd("h",[RTimeFactor],[DepartTime])-DateAdd("h",[DTimeFactor],[ArrivalTime]),Time()))
AS TotalTime
FROM tblAirports INNER JOIN (tblAirlines INNER JOIN
(tblFlightSchedule INNER JOIN tblAirports AS tblAirports_1 ON
tblFlightSchedule.ToAirport = tblAirports_1.AirportID) ON
tblAirlines.AirlineID = tblFlightSchedule.AirlineID) ON
tblAirports.AirportID = tblFlightSchedule.FromAirport
WHERE (((tblFlightSchedule.FltNum)<>"N/A"));
Allen Browne said:
Create a query that uses both the table you currently have the form
bound to, and also the table that supplies the values for the combo.
Set the RecordSource property of your form to this query.
Now you have the fields you want to sort on in your query, and you
can use the Sorting row to sort them as you wish.
In the Order By Properties of my form, I have the following
(FromAirport and ToAirport are both combo boxes):
[FromAirport], [ToAirport], [TotalTime] DESC
This works fine, except that I want to Sort by Column(2) of both
[FromAirport] and [ToAirport]
I have tried about every combination of things, but nothing seems
to work. For example, [FromAirport].Column(2) doesn't work,
[FromAirport].[Column(2)] doesn't work, etc, etc...