Data Base Sorting Order

A

Antman

I'm new to Access and know very little about the program yet. I need to
do two things with my data base. 1st is I need to be able to sort in a
numerical rather than a ASCII order. How can this be done?
2nd is I need a macro assigned to a hot-key that will allow a block of
new items to be imported from Excel to the bottom of the data base and
then to be sorted into the main body of the database and maintain the
correct numerical sort order. Any help will be greatly appreciated.
 
T

tina

where you say "database", i believe you actually mean "table". data is
stored in a table in Access, and one database may have many tables in it -
each with its' own set of data.

if you want to sort a table field in numerical order, the field must be
either 1) a Number data type, or 2) have data of a single fixed length, with
leading zeros where necessary. for example, the values 1 - 10, stored as
Text data type, will sort as

1
10
2
3
4
5
6
7
8
9

UNLESS you use a fixed length of two digits for that field's data in each
record, in which case you'll get a sort that *looks* like a correct numeric
sort, as

01
02
03
04
05
06
07
08
09
10

if you're going to do any arithmatic calculations with the data, or if you
don't want leading zeros, then you'll need to store the data in that field
as Number data type.

to import data from Excel into a table, using a macro, you need to first
create an Import Specification using the Import Wizard, and save the
specification. then you can call that particular specification (by name) in
your macro, and import to an existing table. the imported data will
automatically be appended to the "bottom" of the table. if you have an index
on the number field in the table, the new records will automatically be
sorted into their proper places within the existing records, according to
the values in the indexed field.

since you're new to Access, the first thing you'll want to do is search the
Help file for any term you're not familiar with in this post, to read up on
it. also, recommend you go to http://home.att.net/~california.db/tips.html
and read all the tips, focusing first on tips #1 and #2, in that order.

hth
 
Top