Link to home
Start Free TrialLog in
Avatar of sailr
sailr

asked on

Column Display Order in Datasheet view

Hi All
I have a form with a subform which gets its recordset from different queries. A combo box on the main form determines which query will be used to fill the recordset of the subform.
For example when a user selects "Company" from the combo box. a query designed to sort data on company will be used to fill the subforms's dataset.
My problem is that I need to display the company field as the 1st column in the data sheet.
This ofcourse will change depending upon the choice made from the combo-box. Is it possible to change the display position of the columns in datasheet programmitically?
Avatar of jadedata
jadedata
Flag of United States of America image

Hey sailr!

  You need to assure that the Company field is always the first column to fill a control.
  The datasheet view is driven by the ordinal position of the form controls

  You can change the ordinal positions of the forms controls but only while the form in is design view.
  If you are dynamically assigning bindings to controls in an interative routine, you could re-write the recordsouce sql in the field order needed to present the view you desire.

regards
Jack
ASKER CERTIFIED SOLUTION
Avatar of MrRobin
MrRobin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sailr
sailr

ASKER

Thanks jadedata, I had already tried re-arranging the fields in the sql but that had not worked.

However MrRobin's suggestion worked just the way I wanted it to. Thanks MrRobin.