achtergrond kleur automatisch laten veranderen

Appie

New member
Local time
Today, 22:57
Joined
Nov 10, 2006
Messages
8
Hoe kan ik de achtergrond kleur van een invoer veld automatisch laten veranderen als de ingevoerde datum verstreken is??

Heb al het een en ander geprobeerd met rgb.
If me.veldnaam <= date then Me.veldnaam.BackColor = RGB(255, 0, 0)



Echter doet acces hier niets mee.:confused:
 
Last edited:
Strange kind of English you have.... I suggest using the "normal" english ;-)

Lucky you I can read your strange dialect...

If you want to try and change the background color of controls ... I suggest you look into Conditional Formatting...

greets from amsterdam ;)
 
I have look into conditonal formatting but I don't now how it works.
Can you give me an example of it??
And sory for the Dutch my Englisch is not so well.

Greets from Friesland
 
It is pretty easy if you really try...

I am not sure, but have you had a look around the samples part of the forum?
Lots of things in there, maybe on CF as well...
 
I have some samples only I do not understand how it work.
Where do I put it :
In the form or in a module :
And how do I make it to work into my sub form??

The input field is Me.tekst21 . This field containing the end date from the cliënt.
All wat I want to do is if the (end date -30) is past then it must have a red backcolor.
 
Just FYI, there are limitations to the built-in conditional formatting.
  • You only have 3 conditional formats to use.
  • It won't work for continuous forms. The formatting applies to all rows in a continuous form based on the currenylt selected record.
Not sure what your situation is but I thought I should point it out.
 
Thanks for all off your help I have solve the problem with:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
'There are a few ways to do this. You could use the On Print of the Details section of your report to read:
If [Eind datum] > Date + 60 Then [Eind datum].ForeColor = RGB(255, 255, 255)

End Sub

And put it into the report on the detail.

The end date will be print 60 days befor the date.
But:
The input field is Me.tekst21 . This field containing the end date from the cliënt.
All wat I want to do is if the (end date -30) is past then it must have a red backcolor.
will not work jet.
 
It is true that you're limited to 3 conditions using Conditional Formatting, but
It won't work for continuous forms. The formatting applies to all rows in a continuous form based on the currenylt selected record.
is not true, at least not in Version 2000 and presumably in all subsequent verions. It'll work just fine in Single, Continuous or Datasheet views.
 
All is almost work now
I did make Into Query a field "Expr2"
Expr2: (([Eind datum]-60)<Date())=True

And into the sup form
a field with name "shpRectangle"
Private Sub Form_Current()

If Me.Text23 = -1 Then
Me.shpRectangle.BackColor = RGB(255, 0, 0)
Else
Me.shpRectangle.BackColor = RGB(255, 255, 255)
End If

End Sub
So the shpRectangle will be red or white depending, if the date is past.
 
Last edited:
Into the print view the end date will be show
but if I print the report the end date will be blanc
Do any now why the end date not be print??

I use for selection :

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
'There are a few ways to do this. You could use the On Print of the Details section of your report to read:
If Me![Eind datum] > Date + 60 Then Me![Eind datum].ForeColor = RGB(255, 255, 255)
End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom