hi there
on a system i have i have an order entry form where there are two important fields- OrderID and CustomerID. I am using an SQL statement to pull the values into the form from the different tables. the problem however is that the form is showing records sorted by CustomerID as opposed to OrderID.
here is my sql statement in the forms data source:
SELECT tblOrders.OrderID, tblOrders.CustomerID, tblOrders.DateOpened, tblCustomers.CustomerName FROM tblOrders INNER JOIN tblCustomers ON tblOrders.CustomerID=tblCustomers.CustomerID;
I thought this may be the cause of it but after playing around with it i cant make it sort by OrderID. OrderID is the primary key of tblOrders and the CustomerID field is simply linked to the primary key of tblCustomers, so I cant understand why its not sorting by the primary key.
I have tried the OrderBy field in the form properties but cant seem to make this work....
anyone have any ideas how to switch this to sort by OrderID?
thanks in advance
dd/mm/yy
on a system i have i have an order entry form where there are two important fields- OrderID and CustomerID. I am using an SQL statement to pull the values into the form from the different tables. the problem however is that the form is showing records sorted by CustomerID as opposed to OrderID.
here is my sql statement in the forms data source:
SELECT tblOrders.OrderID, tblOrders.CustomerID, tblOrders.DateOpened, tblCustomers.CustomerName FROM tblOrders INNER JOIN tblCustomers ON tblOrders.CustomerID=tblCustomers.CustomerID;
I thought this may be the cause of it but after playing around with it i cant make it sort by OrderID. OrderID is the primary key of tblOrders and the CustomerID field is simply linked to the primary key of tblCustomers, so I cant understand why its not sorting by the primary key.
I have tried the OrderBy field in the form properties but cant seem to make this work....
anyone have any ideas how to switch this to sort by OrderID?
thanks in advance
dd/mm/yy