Color box in details of a form (1 Viewer)

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
Hi to all
I want to add a color box or whatever you think is easyest and when i open a form in every detail line read from another table and if the date diff is less than 30 days change to orange and if the date diff is less then 10 change to red.

Any idea how i can do something like this???

I don't know what to add in the detail line (I have add a rectangle) and how i perform the code i want in every detail line.

I hope you do not confuse

Thanks and regards.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
Use a textbox and then look at Conditional Formatting, on the ribbon.
 

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
First of all thanks for your quick answer.
The point is. I have to read for every detail line another table.
How can i do something like this?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
Not knowing the specifics, offhand I'd say to get that value in a query that the form is based on or use DLookup().
 

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
I have a field name Min_Expire.

I want in the Conditional Formatting when the date less than 30 days color change to orange

I have try [Min_Expire]< DateAdd("d", 30, Now()) but did not work

PLEASE HELP!!!!!!!!!!!!!!!!!!!!
I'm using access 2003
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
Can you attach the db here? That looks like it should work as an expression.
 

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
Form Gun_Header
Last field

If the Min_Expire < 30+ Now change the color to orange.


Thank yoy very much.
 

Attachments

  • ΑΚΚΟ_.zip
    723.5 KB · Views: 43

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
What you have appears to be working, as does the formula above. The third record is highlighted, which seems appropriate to the data.
 

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
The 3rd record is red and is less than Now()
I want if the same field is less than 30 + now the color be Orange or yellow......
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
Ah, you want a second rule. First is

[min_expire]<Date()

color red, second is:

[Min_Expire]<DateAdd("d",30,Now())

color orange.
 

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
As i told you i had already try this and they did not accepted.

But as an idea yes this is what i want....
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
It is working for me.
 

Attachments

  • Format.jpg
    Format.jpg
    50.2 KB · Views: 32

vagelisr

Registered User.
Local time
Today, 08:04
Joined
Apr 28, 2011
Messages
87
Did you have any idea why it is not working for me??

I use access 2003 with SP3
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:04
Joined
Aug 30, 2003
Messages
36,133
No, the sample didn't contain the second condition. I have 2010 on this computer, but that shouldn't be a factor.
 

Users who are viewing this thread

Top Bottom