database keeps getting out of order.

S

shhsecurity

I have created a database that tracks employees hourly duties during their
shift. I can order the database using a querie but howdo I make it so that
the database is always in order all of the time?
 
S

Sylvain Lafontaine

There are no physical order as such in a database; you must use Order By
clause(s) on whatever field(s) you want your result to be sorted on.

S. L.
 
S

shhsecurity

Thanks Sylvain. Ok, well is there a way to add a primary key to the database
that will give ID numbers to each report after I organize the database in a
querie and then save the whole database under a different name? When I
created this database, I omitted the primary key.
 
S

shhsecurity

Where and how exactly do I put that code using Order By so that it does this
automatically?
 
S

shhsecurity

Ok so opening the properties of the DAILY_REPORT form and looking in the
Order By filed yeilded this: DAILY_REPORT.[3]

[3] being the Date/Time field

Is this the correct way to use field [3] to Order By?
 
S

shhsecurity

Thank you Joseph for all of your help.
Is this effecting the search function of my combo box if I am looking for a
certain record? I have the times of 2400-0800, 0800-1600, and 1600-2400
that I search for on different dates. Every time I click on a time/date
other than 2400-0800 it will not go to that record. The record switches to
the correct date but not the correct time.

Joseph Meehan said:
shhsecurity said:
Ok so opening the properties of the DAILY_REPORT form and looking in
the Order By filed yeilded this: DAILY_REPORT.[3]

[3] being the Date/Time field

Is this the correct way to use field [3] to Order By?

I believe that should do it. Remember that the last sort is the one you
will see. So any sort in a query etc. will be be overridden by the sort in
the report, witch is what I believe you want. The way to check for sure is
to run the report and check the results.
 
Top