Solved

How to sort data in fields on a form based on date and time?

Posted on 2014-10-23
9
154 Views
Last Modified: 2014-11-02
I have tried using a query to sort the data and for some reason it does not work.

On the “Events_frm” I am trying to add the chronological number of the Event along with the word Event at the beginning of the event description based on the date then time. For example:

“Event 1 – “ The man slipped – 10/22/2014 – 9:00 AM
“Event 2 – “ The man fell – 10/22/2014 – 9:15 AM

If the user enters the events in the wrong order, I want the application to put them in the correct order based on the date and time.
Database101.accdb
0
Comment
Question by:cssc1
  • 4
  • 3
  • 2
9 Comments
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40399571
in the design view of your form, go to data and enter the following in the order field

event_date, event_time
ee1.JPG
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40399580
in case, you couldn't find it, That's the full database, with an extra record that i inserted, and that is showing now on top of the form!
Database101.accdb
0
 

Assisted Solution

by:cssc1
cssc1 earned 0 total points
ID: 40399627
Dany,
  For some reason when I try to open the DB you attached it opens like html code.
Can you please try uploading it again?
Thanks
DB-file.jpg
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 11

Accepted Solution

by:
Dany Balian earned 250 total points
ID: 40401144
uploaded again
Database101.accdb
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40401146
right click on the link, and click save target as.. instead of just clicking! because both of the old attached database file and the new one.. are working.. i tried downloading them from ee and tested them
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 250 total points
ID: 40401173
Or change the RecordSource of the form to:

SELECT * FROM [2-Events-tbl] ORDER BY Event_Date, Event_Time;

You should never base a form on table directly.

/gustav
0
 

Author Comment

by:cssc1
ID: 40404920
Dany,
   Same problem. see attached.
SaveAs.jpg
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40404924
No. Proceed renaming the file to something.accdb

/gustav
0
 

Author Closing Comment

by:cssc1
ID: 40417980
thanks for the assistance
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hit enter key to run macro 13 23
Archiving Access table older than 6 months 9 38
deduplicating based on criteria 2 21
Reference Controls on subforms 7 28
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question