ulkomalainen,
AFAIK, you can't do this directly in a query.
You can, however based on user input use VBA to set the OrderBY property of the form that is bound to this query, or modify the recordsource property of that form so that the ordering is based on user input.
How is this query being used?
Main Topics
Browse All Topics





by: BellonePosted on 2009-10-20 at 06:56:17ID: 25614141
Don't think you can use IIF in this context. Set a variable for user's choice and open a dialog form to get it. Then construct your SQL statement as another variable, e.g.
dim vChoice
dim sSQL
[Get vChoice here]
sSQL = "SELECT, blah, blah FROM blah, blah
if vChoice = 1 then
sSQL = sSQL & "ORDER BY rooms ASC & ";"
else
sSQL = sSQL & "ORDER BY rooms DESC & ";"
end ifg