Column order in Datasheet view

A

andrei

Hi group,

How can I programatically set the order of the columns when I display a form
in Datasheet view ?
I know I can select, then drag and drop each column at the desired position,
then save the form, but I would like to be able to set the order through
code, too.

Thank you,

Andrei.
 
J

John Vinson

Hi group,

How can I programatically set the order of the columns when I display a form
in Datasheet view ?
I know I can select, then drag and drop each column at the desired position,
then save the form, but I would like to be able to set the order through
code, too.

You should be able to create a Query selecting the fields in any
desired order, and use that Query as the recordsource for the form.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
F

fredg

Hi group,

How can I programatically set the order of the columns when I display a form
in Datasheet view ?
I know I can select, then drag and drop each column at the desired position,
then save the form, but I would like to be able to set the order through
code, too.

Thank you,

Andrei.

In the form's Load event:
Me!ControlA.ColumnOrder = 3
Me!ControlB.ColumnOrder = 2
Me!ControlC.ColumnOrder = 1
Me!ControlD.ColumnOrder = 4
 
Top