Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

color column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
a - 26 Jul 2007 01:02 GMT
thank you
is there any way to color columns in subform data sheet
example
let user change color of every column
notes
i can use conditional form but this not let user select prefer color
i hope you understand me
Graham Mandeno - 26 Jul 2007 01:39 GMT
You can modify conditional formatting "on the fly" using code.  For example:

Public Function SetColumnBackground(ctl as Control, NewColour as Long)
Dim fc as FormatCondition
With ctl.FormatConditions
   If .Count = 0 Then
       Set fc = .Add(acExpression,,"1=1")
   Else
       Set fc = .Item(0)
   End If
End With
fc.BackColor = NewColour
End Function

To set a column background to bright green:
   Call SetColumnBackground(Me("Control1"), RGB(0,255,0))

Note that this assumes conditional formatting is not being used for anything
else.  If it is then your code would need to do a bit more work.

Signature

Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

> thank you
> is there any way to color columns in subform data sheet
[quoted text clipped - 3 lines]
> i can use conditional form but this not let user select prefer color
> i hope you understand me
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.