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 2005

Tip: Looking for answers? Try searching our database.

Change colour on command button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JanetF - 08 Jul 2005 17:11 GMT
Hello,

I have a command button on a form, cmdComments, and it has the letter "i" on
it.  This command button opens a Comments popup form and allows the user to
either view or add comments for each record.  The comments field (called
TaskDesc) in the Comments popup form is a field that is part of the table the
main form is based on (tblTasks).  I would like that letter "i" to be the
colour red if there are comments already entered for a record and remain
black if there are no comments added.  Any help would be appreciated.

Thanks,
Janet
Steve Schapel - 08 Jul 2005 20:00 GMT
Janet,

See my reply on your other thread on this topic.

Signature

Steve Schapel, Microsoft Access MVP

> Hello,
>
[quoted text clipped - 8 lines]
> Thanks,
> Janet
Marshall Barton - 08 Jul 2005 20:21 GMT
>I have a command button on a form, cmdComments, and it has the letter "i" on
>it.  This command button opens a Comments popup form and allows the user to
[quoted text clipped - 3 lines]
>colour red if there are comments already entered for a record and remain
>black if there are no comments added.  Any help would be appreciated.

As long as the form is opened in Single Form View, you can
use code something like:

If Nz(Me.TaskDesc, "") = "" Then
    Me.cmdComments.ForeColor = vbBlack
Else
    Me.cmdComments.ForeColor = vbRed
End If

in the form's Current event.

You might want to also use analogous code in the popup
form's Close event.

Signature

Marsh
MVP [MS Access]

 
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.