datasheet column color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a Access2003 from that is displayed in datasheet view. i have for
example column 1, column 2 and column 3.

im trying to mimic a form i have on paper and column 3 is grayed out to
indicate it is to be used under a specific condition

i there a way to have a full column in datasheet view a certain color
whether or not it contains any data?
 
Set the Enabled property of the TextBox control in Column 3 to NO. This will
grey out the contents of this field. Alternatively, if you want more control
over the "Disabled" appearance, you can use Conditional Formatting.

In form Design view, select the TextBox control in Column 3
With the control selected, goto the Format Menu and select Conditional
Formatting

In the CF GUI dialog select Expression Is, then call a small Custom
function passing a pointer to the TextBox control in Column 3. THe example
below assumes the name of the TextBox control is txtcusName. Change it to
match yours.
ColorColumn([txtcusName])

Create the custom function within a standard Code module. Simply have it
return TRUE to enable CF for this control, and every instance of this
control in Column 3.

Public Function ColorColumn (ctlCF As Control) As Boolean
ColorColumn = TRUE
End FUnction



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top