Largest Value

  • Thread starter Thread starter Donna
  • Start date Start date
D

Donna

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.
 
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 :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top