Columnorder doesn't seem to work

I have created a split view form to provide a summary of outstanding activities. On the top half of the screen, all the variables for the currently selected record are displayed.

Also at the top is a combo box that allows the user to choose a desired filter option that applies a filter and tries to display selected columns in the desired order in the datasheet view list on the bottom half of the form. Different users only want certain variables to appear in the datasheet in their desired order so I am using the Visible and ColumnOrder properties to achieve this.

What I am finding strange is that it is not always working reliably. E.g. In one instance I set columnorders in one sequence and they worked fine and then I simply reversed the columnorder and one of the fields won't display.

Does anyone know if there is anything I need to look out for that could be causing this issue?
LVL 1
Rob4077Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob4077Author Commented:
Thanks bcnagel. Had a look at it and I am wondering if the comment " the Sort Order (OrderBy) seems to have some effect on their column order" may be the issue. Have you come across this before?
bcnagelCommented:
Yeah, I saw that. I haven't run into that issue before, but maybe someone else has found a way to deal with it. I suppose one thing to ask is: do you have to sort programmatically? Can you just leave sorting alone and simply re-order the columns?
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I don't know if you'll get this to work effectively with the new Split Form. The two areas of that form are tightly bound, so attempting to show/hide columns in the dataview portion is very likely being reset when you trigger certain actions.

If you must have this functionality, then create your own split form with two SubForms. You can easily tie the two together, and you have a lot more control over what happens.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Dale FyeOwner, Developing Solutions LLCCommented:
I would agree with Scott about the Split form.  When I or a client wants that functionality (rarely) I build my own as described by Scott.

I have an article about retaining user column preferences located here.  What I have found, is that the best way to get the columns in the order you want them, is to (in reverse order) set the columnOrder property to zero (0).  This will make it the first column in the datasheet, then do the next one, which shifts the first one set to column2, ...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob4077Author Commented:
Yeah I usually use linked forms but this form was prepared in a hurry and needed lots of variants quickly.  I think I will split it as suggested. Thanks for the tip on columnorder. Makes coding easier too. Will look up the references and close out the question tomorrow.  Thanks for your help
Rob4077Author Commented:
Thanks to all of you for your contribution. Dale, your article was very informative and Scott, your suggestion is very sensible. I am only disappointed that SouthMod removed the link that bcnagel posted. There were a few points in that discussion that I wanted to review but unfortunately I didn't keep a copy of the link.
Rob4077Author Commented:
I would really love to get hold of the deleted link again. Is there any way without making my email address public?
Dale FyeOwner, Developing Solutions LLCCommented:
Rob,

You can click on bcnagels hyperlink to get to his/or her profile.  From there, you can send them a message by clicking the Message tab.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.