Solved

Column Display Order in Datasheet view

Posted on 2003-12-08
3
979 Views
Last Modified: 2007-12-19
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?
0
Comment
Question by:sailr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9897333
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
0
 
LVL 8

Accepted Solution

by:
MrRobin earned 250 total points
ID: 9897347
You can use the ColumnOrder property of a control to specify the position of a column in datasheet view.
0
 

Author Comment

by:sailr
ID: 9897427
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.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question