Create Sort index (not primary) via code

D

Dan

How do you add sort properties to a table created via VBA? I can add a primary unique index, but can't figure out how to create table "cust" and have it sort by "cust_name" without making cust_name the promary unique index
Thanks
Dan
 
D

Douglas J. Steele

You don't. Records in tables don't have a predictable order. That's part of
relational database theory.

If the order is important, create a query with an ORDER BY clause in it, and
use the query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Dan said:
How do you add sort properties to a table created via VBA? I can add a
primary unique index, but can't figure out how to create table "cust" and
have it sort by "cust_name" without making cust_name the promary unique
index.
 
D

Dorian

If your table is big, also make the fields to be sorted on INDEXED - this will speed up sorting.
 

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