Need a helping hand to resolve pending problem (1 Viewer)

Fandy

Member
Local time
Today, 05:27
Joined
Mar 26, 2021
Messages
37
Hi everyone,
Please I have created Access form and set the default view to split. My problem is I want to
set the arrangement of the data in my form to descending order by date (newest to oldest)
so that I can see the latest entries first in the datasheet below. I have tried severally but
none is working. I would therefore be very happy if you could get help from able members
of this platform to resolve the problem. Below is the snapshot of the form.
Counting on your maximum support and response. Thank you.
Access form.JPG
 

Minty

AWF VIP
Local time
Today, 06:27
Joined
Jul 26, 2013
Messages
10,371
What the SQL of the recordsource.
If it's the table directly, create a query based on it and put Descending in the date field.
 

Fandy

Member
Local time
Today, 05:27
Joined
Mar 26, 2021
Messages
37
How do I make the user enter the data when my form is query base
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:27
Joined
Sep 21, 2011
Messages
14,317
There is also an OrderBy property on the data tab of forms?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 19, 2002
Messages
43,302
Forms can be bound to queries or tables. Queries are better since they give you more options and can be filtered.
 

Fandy

Member
Local time
Today, 05:27
Joined
Mar 26, 2021
Messages
37
Forms can be bound to queries or tables. Queries are better since they give you more options and can be filtered.
Please how can a user enter data into a form bound by query. Can you please direct me so I try it?
 

Minty

AWF VIP
Local time
Today, 06:27
Joined
Jul 26, 2013
Messages
10,371
On your form where it says Record Source press the three little dots (ellipses )
1670605474314.png

When it asks you do you want to build a query press yes.
Add all the fields you need from the table.
Under the Date field where it says "Sort" select descending.

Close the query, saying yes if it asks you to save, give it a sensible name qryMyFormSorted.

That's it.

By the way, before you get too far, change the name of the field to PaymentDate or something else. Date is a reserved word, and a function and WILL cause you problems further down the road.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:27
Joined
Sep 21, 2011
Messages
14,317
Yes. I just saw it but when I set to date, I don't know how to make it descending order
add the word DESC after a space and your date field.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 19, 2002
Messages
43,302
You don't do anything special. You just bind the Form or Report to either. The query of course, must be updateable if you want the form to be updateable. I build my queries first. That simplies the form/report because I have ordered the columns the way I want them to appear and only selected the ones I want. So, even though the wizard creates ugly results, at least it gets all the controls built for me and then I can make them pretty:)

Throughout Access, Select queries and tables are interchangeable for most purposes. This is why Access will NEVER allow you to create a query and a table with the same name. You can have a form named Customer as well as a Report and a macro but you can only have EITHER a table or a query with that name. WHY? Because as I said, Access treats these two objects as interchangeable and therefore, they can't have duplicate names or Access couldn't tell what you were referring to.
 

Users who are viewing this thread

Top Bottom