Use VBA to sort a continuous Access form by different fields

tblTrans includes fields: dateTrans, amtTrans and typeTrans.  tblTrans contains history-to-date data (multiple years).  

A continuous form, frmTransDetail, opens when the user has specified what date range of transaction detail from tblTrans the user wishes to display, using a range-selection popup form.

Form, frmTransDetail is bound to a query (qryTransDetail) which constrains the range of data via "between getStartDate() and getEndDate()" in its date criteria property, which are functions called from a wrapper module used to store these specs.

By default, the data is ordered by the transDate field; however, often the user must right-click the typeTrans or amtTrans fields to select "sort ascending/descending" to re-order the records.  I would like to provide an OptionGroup to automate this.

Do I re-configure the query (strSQL = ". . .; doCmd.runSQL strSQL) and requery the form or would it be better to bind the form to tblTrans (not qryTrans), using =getStartDate() and =getEndDate() in its filterOn property and alter the orderBy property at the table level?

I beleive my questions has 2 parts: (1) What is the best way to limit a form on a value range of one of its controls [filtered table or query from that table) and (2) how can VBA  say, on a button  re-sort the displayed records similar to the header buttons in MS Dialogs resort the listing.

Thanks,
GregC
Greg-CAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Greg-CAuthor Commented:
I have been fooling around with this and believe that I was looking for a more complicated solution than required.
I've done what I needed, using the query, by executing this code:
    Me.OrderBy = "tblTrans.transType"
    Me.Requery
I'll leave the question open for alternate solutions.
Thanks,
GregC
 
0
Greg-CAuthor Commented:
I'm closing the question with my own answer:
Me.OrderBy = "tblTrans.transType"
Me.OrderByOn = True
Me.Requery
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.