Syncing datasheet view order sequence with design view layout sequence?

peskywinnets

Registered User.
Local time
Today, 14:07
Joined
Feb 4, 2014
Messages
578
Is there any way of syncing these two (or forcing them to mirror one another?), so that the sequence/order is the same whether in design view or datasheet view?
 
Last edited:
not without code

forms use the left property to determine how far from the left side of the form the control appears, whereas datasheets use the columnorder property to determine which column a control appears in. For widths, use the control width and columnwidth properties. to identify associated labels (not relevant for datasheets) use the controls(0).name property

so you would need to loop through your controls to determine the leftmost control and assign 1 its columnorder property, then repeat for the 2nd leftmost and so on.

or going the other way round, loop through the controls to assign 0 for the left property of the control which is column 1, width for the first column to the left of the 2nd column etc and do the labels at the same time

This code can only be run when in form or datasheet view - not sure which event you would use to trigger it - you'll need to experiment
 
Thanks...I find it a bit of an oversight that the two don't mirror each other out of the box (or at least a user selectable option to mirro one another)...it's a headtrip looking at a query in datasheet view, moving a column, then the design view bears no resemblance layout wise.

hey ho...

Thanks once again.
 
I just line them up vertically in the design view. Easier to find them in a long list - and in datasheet, formatting, position etc can all be done in datasheet view so no need to visit the design view unless you want to add new controls or change a control caption
 
The Datasheet order matches the order in the Design View if you don't move them in the Datasheet.
 

Users who are viewing this thread

Back
Top Bottom