If strOrder = "" Then
strOrder = "Idate"
strDirection = "ASC"
Select Case strOrder
Strsql = Strsql & " ORDER BY ship_order_id " & strDirection
Strsql = Strsql & " ORDER BY LOWER(Sender_Name)" & strDirection
Strsql = Strsql & " ORDER BY LOWER(Receiver_Name) " & strDirection
Actually, I have taken this from an asp form so some parts obviously won't work, not quite sure how to adapt it to VBA
If you don't need it to be variably ordered and there will be no parameters, I'd take the query out of VBA and store it as an actual query, where updating it will be much easier. With that, you could use the following:
SELECT tbl_ShipOrders.ship_order_id, tbl_ShipOrders.receiver_id, tbl_ShipOrders.sender_id, Sender.company AS Sender_name, Receiver.company AS Receiver_name,
INNER JOIN tbl_Customers AS Sender
ON Sender.custid = tbl_ShipOrders.Sender_ID)
INNER JOIN tbl_Customers AS Receiver
ON Receiver.custid = tbl_ShipOrders.Receiver_ID
ORDER BY Sender.company, Receiver.company
After it's defined, use DAO with the current database to open it into a recordset and process.