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 / March 2007

Tip: Looking for answers? Try searching our database.

Conditional formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TotallyConfused - 15 Mar 2007 17:27 GMT
I have a form that I need to add some conditional formatting.  I have a date
field contingent on two other fields.  How do I write for the expression - If
field 1 is null than field 2 is greyed out.?  Thank you for any help.
strive4peace - 15 Mar 2007 19:03 GMT
When you say "greyed" out, if you mean Disabled, then you cannot do this
with conditional Formatting, you need to use:

form Current event to set when the record changes
AND
control AfterUpdate event for control this is based on

'~~~~~
  dim mBoo as boolean
  mBoo = IIF(isnull(me.controlname1), false, true)
  me.controlname2.enabled = mBoo
'~~~~~

if you just mean that the color is gray, then

1. select control to change color of
2. from menu: Format, Conditional Formatting
Expression is --> If isnull([controlname])
choose gray foreground color

Warm Regards,
Crystal
 *
     (:  have an awesome day  :)
  *
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
  *

> I have a form that I need to add some conditional formatting.  I have a date
> field contingent on two other fields.  How do I write for the expression - If
> field 1 is null than field 2 is greyed out.?  Thank you for any help.
TotallyConfused - 15 Mar 2007 22:11 GMT
I am sorry I meant If it is NOT null - how do I write it.  I tried
IF(IsNotNull([CONTROL NAME])) not working.  This is in FORMAT, Cconditional
Formatting.

Thank you.

> When you say "greyed" out, if you mean Disabled, then you cannot do this
> with conditional Formatting, you need to use:
[quoted text clipped - 29 lines]
> > field contingent on two other fields.  How do I write for the expression - If
> > field 1 is null than field 2 is greyed out.?  Thank you for any help.
scubadiver - 16 Mar 2007 14:03 GMT
Insert one of the following in the "after update" event and Replace FIELD1
and FIELD2

If me.FIELD1 = Null then me.FIELD2.enabled = false

or

If me.FIELD1 is Null then me.FIELD2.enabled = false

> I am sorry I meant If it is NOT null - how do I write it.  I tried
> IF(IsNotNull([CONTROL NAME])) not working.  This is in FORMAT, Cconditional
[quoted text clipped - 35 lines]
> > > field contingent on two other fields.  How do I write for the expression - If
> > > field 1 is null than field 2 is greyed out.?  Thank you for any help.
 
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.