Different sort order on form, to SQL recordsource ?

liamfitz

Registered User.
Local time
Today, 17:19
Joined
May 17, 2012
Messages
240
I have a mainform based on a simple query ( qryAllClients ) SQL statement i.e.
Code:
SELECT tblClients.Client_ID, *
FROM tblClients
ORDER BY tblClients.Surname, tblClients.Forename;
However, it doesn't open the form in alphabetical name order a la telephone directory style. When I 'run' the query 'standalone', it presents the datasheet view perfectly, and as expected in alphabetical order ? Would opening my mainform, which I do, at a new record, i.e just past EOF, have any bearing on this anomaly ? Can't think of any other possible reason.:(:(
 
Not a Programmer but long time user . using ac 2003

I am assuming you are viewing the records by Default view. Continuous Forms and require the records sorted as per your criteria I would try putting your tblClients.Surname, tblClients.Forename
Directly in the properties Data Order by: and it should work

As to the effect of opening up as a new record not sure.
 
Have you tried:
Code:
SELECT tblClients.Client_ID, tblClients.Surname, tblClients.Forename, *
FROM tblClients
ORDER BY tblClients.Surname, tblClients.Forename;
 
No bob fitz - but I will, and if not, ypma's suggestion. I take his point. ypma - it's not continuous form, it's Single Form is the Form view. Thank you both - will update you anon.
 
Your suggestion works perfectly ypma. Many thanks.
 
"Your suggestion works perfectly ypma. Many thanks. "

You are welcome, its very gratifying for me as a non professional programmer to receive positive feedback.
 

Users who are viewing this thread

Back
Top Bottom