Column Order in form Datasheet View

Christine Jackson

Registered User.
Local time
Yesterday, 22:39
Joined
Mar 21, 2008
Messages
15
Hi

Simple question i know, but unfortuantely its driving me crazy. Is there anyway I can alter the order in which columns are shown in Datasheet View on a Form so that it opens up in the same order next time i open it?

Thanks

Chris

:eek:
 
Use the Object Browser (F2 key) in the VB Editor. It reveals much about objects.

Another useful piece of code is a loop through the properties of an object. For example, type this line into the Immediate Window to reveal the names of the properties of a field.

Code:
Set db = CurrentDb: For Each p In db.TableDefs("Table1").Fields("fieldname").Properties: ? p.Name: Next

Similar lines can be applied to any object and it is so fast to do that it is a useful alternative to the Object Explorer of even looking at the design view of the object.

Properties of a control:

Code:
For Each p In Forms.formname.controlname.Properties: ? p.Name: Next

It will often suggest where you should be investigating.
 
This should do the trick.

Me.Student_ID.ColumnOrder = 1
Me.Family_Name.ColumnOrder = 2
Me.Preferred_Name.ColumnOrder = 3

etc
 
I found the following to work for me:

  1. [FONT=&quot]Open the form that has all of the subforms on it.[/FONT]
  2. [FONT=&quot]re-arrange or size the fields in the subforms as you wish them to be[/FONT]
  3. [FONT=&quot]click on (highlight) one of the columns in the subform[/FONT]
  4. [FONT=&quot]on the ribbon, in the text formatting group, center this column (or change any attribute in the text formatting group), then change it back to left justified (or Bold and then un-bold the subform)[/FONT]
  5. [FONT=&quot]Now - close the form, you will be prompted to save, do so[/FONT]
Your subform should now have all of your changes.
Has worked for me without fail
 
BMiles13's idea worked for me - and it's simple!

Thanks!
 
A thought...if you go with RainLovers idea, you could then put a button on the form called "Reset Col Order" then if a user has a custom order, they can drag cols around and reset them to the preferred order.
 
Hello there!

I also noticed that, in design mode, the "Tab order" (available in the tab "Other" of the property sheet) is reflecting the column ordering of the datasheet view.

It also works with split forms.

Just to complete the panel of answers already given here.
 
Great thanks to BMiles13
I've spent hours trying to set one column as the 2nd column.
Without Bmiles13's solution, I would have got nuts !
Thanks again,
Michel
 

Users who are viewing this thread

Back
Top Bottom