Change a field attributes in a query eg width

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Change a field attributes in a query eg width

Post by Pat »

That all sounds very straight forward, the only thing i need is how to set a control's columnorder or columnwidth.
One thing though, in your first example you referenced a query and not the form to get the Order and Width, i thought you now say that you reference the form and not the table or query behind it.

Can you attach that database again please.
Last edited by Pat on 11 Aug 2010, 10:05, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change a field attributes in a query eg width

Post by HansV »

What is the problem? If the download failed, could you try it again?
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Change a field attributes in a query eg width

Post by Pat »

Sorry about that, i missed seeing the database, i now have it and will study it.
Thank you Hans, we seemed to cross posts there.

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change a field attributes in a query eg width

Post by HansV »

The code that I posted in my first reply was intended to set the column width and column order of a column in a query.

A bit further in the thread you mentioned that you wanted the user to be able to move and resize columns in a datasheet form, so the latest example is for a datasheet form.
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Change a field attributes in a query eg width

Post by Pat »

Yes you are quite right re the form vs query.
Thank you, the variable CodeContextObject is nifty. I understand the example database.

I had never heard of that before, i learn something again from you, many thanks.

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change a field attributes in a query eg width

Post by HansV »

CodeContextObject is a handy and powerful variable because it lets you write code in a standard module that can be called from any form (or report) without having to pass a reference to the form (or report) or its name.
Best wishes,
Hans