Is there a way to sort table using DoCmd.Opentable

  • Thread starter Thread starter Ben
  • Start date Start date
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
 
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
 
Why are you trying to open a table? You should never be working directly
with tables: you should always have a form.
 
Back
Top