which event....?

CHAOSinACT

Registered User.
Local time
Today, 21:11
Joined
Mar 18, 2009
Messages
235
i have a datasheet(see attached jpgs if ya like) which if you click on the "description" field will open the relevant form with the record. simple....so far lol.

this was easy; a simple onclick macro solved it. now i need to adjust the color of description based on the time it was entered - over 14 days i need the blue link to go red.

that means i need to check the data for each record in the "Detail" section and i don't seem to be able to find it...any ideas? btw, THIS IS A SUBFORM IN REALITY! though i can't get it to work opening the sub form separately...i would have thought the on paint of the Detail but no joy so far.

here is the code i thought MIGHT do it:

If DateDiff("d", Me!DateSubmitted.Value, Date) > 14 Then
Me!Description.ForeColor = RGB(255, 0, 0)
Else
Me!Description.ForeColor = RGB(0, 0, 255)
End If

just not sure where to put it.

as i mentioned, screen grabs attached to be totally clear, thanks in advance!
 

Attachments

  • datasheet_formview.jpg
    datasheet_formview.jpg
    36.3 KB · Views: 83
  • datasheet.jpg
    datasheet.jpg
    83.2 KB · Views: 84
You can use Conditional Formatting. It's a menu on your menu bar or ribbon. Check the help files for more on this.
 
You can use Conditional Formatting. It's a menu on your menu bar or ribbon. Check the help files for more on this.

looks good but not very flexible, i have tried the expression:

IIf(DateDiff("d",[me]![DateSubmitted].[Value],Date())>14,true,false)

in the "expression" options, but it does nothing, can i refer to the value in the field in my expression there?
 
It will do exactly what you're trying to do. No need for convoluted code.
 
Just saw your images, are those actually hyperlinks?
 
It will do exactly what you're trying to do. No need for convoluted code.

ok worked. with very little but not no code lol. but thats my requirements, thanks much for the help - does seem a bit slow to adapt to scrolling (you scroll, 2 seconds later the format changes) - is that normal?
 
Scrolling is hardly smooth. If you click on the arrows then it might make a difference.
 

Users who are viewing this thread

Back
Top Bottom