Solved

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

Posted on 2014-10-23
9
149 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
 
LVL 11

Accepted Solution

by:
Dany Balian earned 250 total points
ID: 40401144
uploaded again
Database101.accdb
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now