In a data sheet view, set the column names blank, then
auto fit the columns. This sample also shows how to
hide some named fields. In data sheet view, hidden
columns are just columns with width 0.
Setting all the column names to blank is an odd thing
to do, but your alternative is checking all records for
non-null values.
(david)
Sub gsbBS_AutoFit(f As Form)
'(david)
Dim intField As Integer
For intField = 0 To f.Count - 1
If TypeOf f(intField) Is Label Then
Else
If f(intField).Name = "Summary" Or Left(f(intField).Name, 1) =
"_" Then
f(intField).ColumnWidth = 0
Else
f(intField).ColumnWidth = -2
End If
End If
Next
End Sub
<je*********@pioneer.com> wrote in message
news:n7********************************@4ax.com...
I'm building my own crosstab table.
If a crosstab field has no data in the entire field (as a result of
filtering), I don't want to show that field. Is there a way to do
this in a qry or frm object?
I'd use a pivot, but PT are too slow, and they sometimes crash with
amount of data (rows and columns) I'm talking about ..or I get an
exceeds capacity error message.
Thanks
Jerry