On 28 Sep 2005 23:12:19 -0700, "sa****@gmail.com" <sa****@gmail.com> wrote:
when I set visible=false, then entry is not visible in form view, but
still shows up in datasheet view. How do I make a field not to show
based on some condition in datasheet view?
Tx.
Most things that can be done with controls in standard forms can be done with
controls in datasheet view as well, but not in the same way. In this case,
you'll use the ColumnHidden property of the control as opposed to the Visible
property. Also note that you can make a control accessible from expressions
and code, but invisible in Datasheet view by putting it in the form header or
footer.
To see what properties there are that you can use to manipulate datasheet
view, use the object browser (F2 from within the code editor) and skim the
Form object and the Textbox object properties for things that seem datasheet
related. Also note that you can control the color of columns in Access 2000
and newer by using conditional formatting. For a fixed color, just use an
Expression type condition with an expression of True.
Form:
DataSheetBackColor
DataSheetBorderLineStyle
DataSheetCellsEffect
DataSheetColumnHeaderUnderlineStyle
DataSheetFontHeight
DataSheetFontItalic
DataSheetFontName
DataSheetFontUnderline
DataSheetFontWeight
DataSheetForeColor
DataSheetGridlinesBehavior
DataSheetGridlinesColor
FrozenColumns
HorizontalDatasheetGridlineStyle
RowHeight
SubdatasheetExpanded
SubdatasheetHeight
VerticalDatasheetGridlineStyle
Textbox (and other control types):
ColumnHidden
ColumnOrder
ColumnWidth
Note that if you set ColumnOrder at runtime, make sure you set value first for
the column with the left-most target position first because columns to the
right of that position will be renumbered. If you do it in any other order,
the final result might or might not be what you expected.