Cant find column width in VBA (1 Viewer)

ECEK

Registered User.
Local time
Today, 15:37
Joined
Dec 19, 2012
Messages
717
I have two forms. Both are datasheets. Form1 is based on a Query. Form2 is based on a Grouped Query.
Form1 has the following on load:

Code:
    Me.[Field1].ColumnWidth = -2
    Me.[Field2].ColumnWidth = -2
    Me.[Field3].ColumnWidth = -2
    Me.[Field4].ColumnWidth = -2
    Me.[Field5].ColumnWidth = -2

However when I go to type the OnLoad VBA in Form2, the prompts give me "value" instead of ColumnWidth.

I can't understand why Form2 isnt working?

Any help is gratefully appreciated.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:37
Joined
May 7, 2009
Messages
19,230
have you tried to rename the columns of the datasheet (name the textbox different with the name of the field, ie: Field1 rename the textbox to txtField1), then use the name of textbox (txtField1.ColumnWidth = -2)
 

ECEK

Registered User.
Local time
Today, 15:37
Joined
Dec 19, 2012
Messages
717
My solution was to copy Form1 change the data source and rename.
Must have just been a glitch !!!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,257
Not a glitch. arne gave you the solution.
 

Users who are viewing this thread

Top Bottom