Avatar of marian68
marian68
 asked on

sort the records in a form using 2 criteria

How could I see the records in a form using 2 criteria, the date(chronologic order) in a field and ordre alphabetic in another field.
Thank you
Microsoft ApplicationsMicrosoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon
kavik379

Create a query to use as the record source of the form that uses the two criteria you want to Order By.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Maybe using a query as the Record Source for the form ... example:

SELECT Table1.*
FROM Table1
ORDER BY Format([End Date],"yyyymmdd"), Table1.FIELD1;


mx
marian68

ASKER
The form is rather complex. I can not afford to build the form again based on the query you are proposing.
Other ideas?
Thank you
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
marian68

ASKER
Thank you. It works.
"But that is *very* easy to do ... requires virtually no change."
Could you tell me how to do that or give me some hints?
Thank you
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

"Could you tell me how to do that or give me some hints?"
Sure ...
Your Form is currently based on a table, right ?

See the steps below ... just create the SQL off of the existing table and make that the RecordSource - or same it as a Named query ... and use that query.

mx
Capture1.gif
Capture2.gif
Capture3.gif
Capture4.gif
Capture5.gif
marian68

ASKER
Thanks a lot.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

you are welcome ...

mx
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Best to save the newly created query (SQL) as a saved query in the db window, then use that as the RecordSource.  But either way requires no change to the Form really.

mx