Nassu
Programmer
- Nov 22, 2001
- 17
Morning colleagues!
I have fighted with an problem of listbox in MSAccess Form. It is a long story, but brief overview is, that I have a quite complicated MSAccess form with hudge listbox and with code I manipulate with this data (listbox contains a results of dynamic crosstab query).
Problem is. that column widths are also set dynamically by program and I am not able to set "default column width" of listbox. Solution itself works excellent about two years and my client is extremely satisfied, but just one (abovementioned) problem. Problem started, when anmount of data have growed to critical amount. If ColumnWidths property string (semicolon separated widths) exceeds 255 bytes, all remaining columns are dispalyed with certain default width (looks like one inch).
I have tried almost all known and unknown tricks and yesterday I spent with playing around WIN32 API. Looks prospective, but in MSAccess I cannot find handle for listbox control. There are no method .hWnd.
I can imagine, that sensMessage with proper parameter (may be LB_SETCOLUMNWIDTH = &H195) should solve problem, but Win32 API in VBA is not my strong side.
May be any experienced WinAPI guru can help me (on the fly). Otherwise I have to mine in books and internet week(s). And could be it is not possible at all.
Thanks in advance, Oleg
I have fighted with an problem of listbox in MSAccess Form. It is a long story, but brief overview is, that I have a quite complicated MSAccess form with hudge listbox and with code I manipulate with this data (listbox contains a results of dynamic crosstab query).
Problem is. that column widths are also set dynamically by program and I am not able to set "default column width" of listbox. Solution itself works excellent about two years and my client is extremely satisfied, but just one (abovementioned) problem. Problem started, when anmount of data have growed to critical amount. If ColumnWidths property string (semicolon separated widths) exceeds 255 bytes, all remaining columns are dispalyed with certain default width (looks like one inch).
I have tried almost all known and unknown tricks and yesterday I spent with playing around WIN32 API. Looks prospective, but in MSAccess I cannot find handle for listbox control. There are no method .hWnd.
I can imagine, that sensMessage with proper parameter (may be LB_SETCOLUMNWIDTH = &H195) should solve problem, but Win32 API in VBA is not my strong side.
May be any experienced WinAPI guru can help me (on the fly). Otherwise I have to mine in books and internet week(s). And could be it is not possible at all.
Thanks in advance, Oleg