Tables

M

microsoft

Hi All

Is it possible that once data is added to a table it is inserted to the
table in alphabetical order.

Eg.
Name Security Currency
Apple AS US
Microsoft MS US

New Record:
Name Security Currency
Baker BA CAD

Final Result
Name Security Currency
Apple AS US
Baker BA CAD
Microsoft MS US

If so, what needs to be done to facilitate.

Thanks
 
L

LeAnne

Hi,

A table has no order; new records are always added to the end of a
table. While you can sort ascending on the "Name" field (PS. suggest you
pick another field name, as the word "Name" is reserved in Access), this
only affects how the records are *displayed,* not stored. And anyway
it's irrelevent as data should not be viewed in tables. Use the ORDER BY
clause in queries to sort data alphabetically for viewing in Forms or
printing in Reports.

hth,

LeAnne
 
T

TedMi

By definition, tables in relational databases have no inherent order. They
are just a bucket for data store in indeterminate order. What you can do is
request that the data be DISPLAYED in a particular order. The default order
when opening a table is by primary key if one exists, but you can set any
other order by setting the table's Order By property. Open the table in
design view, right click anywhere in the field grid, click properties and
enter one or more field names in the Order By row. For example, to sort a
list of names alphabetically, enter [LastName], [FirstName]. The order of the
fields in the table need not be the same as in the OrderBy row, that is, your
table may have FirstName, LastName and still be ordered by Lastname as the
major sort.
 
K

KARL DEWEY

No. It is just stored there. You can build indexes but you need to sort in
your data display - query results, forms, reports.
 
M

microsoft

Hi

Thanks for all the responses.
The data from this table is represented in a form using combo boxes. Is it
possible that when the user selects the combo box and types the first letter
of one of the records it automatically goes to that record.
 
K

KARL DEWEY

In the RowSource for the ComboBox (in design view) enter the following
information using your table/query and field names.
SELECT [YourTable].[Field1], [YourTable].[Field2], [YourTable].[Field3] FROM
[YourTable] ORDER BY [YourSortField]

You can concatenante multiple fields as [YourSortField].

Set the AutoExpand property to Yes and it will go to the records as you type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top