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 / April 2008

Tip: Looking for answers? Try searching our database.

Largest Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Donna - 08 Apr 2008 20:08 GMT
I have a form where I want the background color to change based on if it's
the most recent record;   If a person has 3 contracts, 200601, 200701,
200801, I want 200801 to be one color and the others to be another color.  
How would I code the on current event to show this.

Right now I am thinking something like:

Dim lngYellow As Long, lngBlue As Long
lngBlue = RGB(161, 205, 253)
lngYellow = RGB(219, 156, 254)

If Me.StartYr.Value = ?????? Then
Me.Detail.BackColor = lngYellow

Else
Me.Detail.BackColor = lngBlue
End If

Any suggestions?  Thanks for your help.
strive4peace - 08 Apr 2008 22:28 GMT
Hi Donna,

If Me.StartYr = nz(dMax("[StartYr]", "[Tablename]", "condition"))

WHERE
Tablename is the name of your table
condition is something like
"PersonID=" & nz(me.PersonID,0)

Warm Regards,
Crystal

 *
   (: have an awesome day :)
 *

> I have a form where I want the background color to change based on if it's
> the most recent record;   If a person has 3 contracts, 200601, 200701,
[quoted text clipped - 15 lines]
>
> Any suggestions?  Thanks for your 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



©2009 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.