A
alex
DAO ColunmWidth
Hello,
Using Access ’03…
I create a table with DAO and open it (as a reference) for my users
behind a popup form.
I want to adjust the column widths to fit the size of the data
contained therein.
I have this code, which works when tested sans popup:
Function ColumnWidthTest()
Dim db As Database
Dim frm As Form
Dim ictl As Integer
Dim ctl As Control
Set db = CurrentDb
DoCmd.OpenTable ("MyTable")
Set frm = Screen.ActiveDatasheet
For ictl = 0 To frm.Controls.Count - 1
Set ctl = frm.Controls(ictl)
ctl.ColumnWidth = -2
Next ictl
End Function
The problem, however; is that there’s no active datasheet since it’s
opened behind/under a popup form. How can I modify the code above
(set frm reference) without using an “active” control?
Thanks,
alex
Hello,
Using Access ’03…
I create a table with DAO and open it (as a reference) for my users
behind a popup form.
I want to adjust the column widths to fit the size of the data
contained therein.
I have this code, which works when tested sans popup:
Function ColumnWidthTest()
Dim db As Database
Dim frm As Form
Dim ictl As Integer
Dim ctl As Control
Set db = CurrentDb
DoCmd.OpenTable ("MyTable")
Set frm = Screen.ActiveDatasheet
For ictl = 0 To frm.Controls.Count - 1
Set ctl = frm.Controls(ictl)
ctl.ColumnWidth = -2
Next ictl
End Function
The problem, however; is that there’s no active datasheet since it’s
opened behind/under a popup form. How can I modify the code above
(set frm reference) without using an “active” control?
Thanks,
alex