By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Changing Sort Order

P: n/a
Greetings,
I have a form with a listbox on it which displays the result of a
query.
I need to be able to change the sort field (DwgNo or Title)on which
the sort is performed by selecting either a DwgNo button or a Title
button. Can I do this by changing the SQL query in code?
Thanks
Evan Pav^ Jenkins
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Use the toolbox wizard to add an option group named SortBy to your form.
Make option 1 Drawing# and option2 Title. Make a copy of your existing
query and give the two queries names of QrySortByDwgNo and QrySortByTitle.
Put the following code in the AfterUpdate event of the option group:
Select Case Me!SortBy
Case 1
Me.RecordSource = "QrySortByDwgNo"
Case 2
Me.RecordSource = "QrySortByTitle"
End Select
Me.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Pav^" <je**********@abc.net.au> wrote in message
news:d3**************************@posting.google.c om...
Greetings,
I have a form with a listbox on it which displays the result of a
query.
I need to be able to change the sort field (DwgNo or Title)on which
the sort is performed by selecting either a DwgNo button or a Title
button. Can I do this by changing the SQL query in code?
Thanks
Evan Pav^ Jenkins

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.