Is there a way to sort table using DoCmd.Opentable

B

Ben

Hi all,

I have a line of code:

DoCmd.Opentable MyTblName, acViewNormal, acReadOnly

I would like to know if there is a way to open the table using the above
line and sort it by a certain field?

Thanks,

Ben
 
D

dymondjack

I'm not sure if there's a way to do that. Tables themselves don't have a
sort order. Have you considered opening a datasheet form with an ordered SQL
statement? Good practice says that tables should never be seen by users
anyway (which is probably why a table doesn't have a sort order).

--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
D

Douglas J. Steele

Why are you trying to open a table? You should never be working directly
with tables: you should always have a form.
 

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