View Full Version : Change to red when Payment is Overdue


Avick
03-16-2000, 10:23 AM
Can anyone help with my small problem.
I have a simple form Based on a Query with:
Invoice ID
Customer
Order Date
Due Date
Paid

How do i get a record to apper red when the due date is passed and the order is still marked unpaid. If an order has not reached its due date it should stay black.
????

Axis
03-16-2000, 12:29 PM
In the OnCurrent property for the form, add the following:
Iif(Me!DueDate<Date(),Me!DueDate.Forecolor = 255, Me!DueDate.Forecolor = 0)

If you want the other fields to appear red as well, you have to add additional statements.

Another option would be to add a label on the form with big red letters that say "PAST DUE" and set its Visible property to No. Then change the statement above to Iif(Me!DueDate<Date(),Me!PastDueLable.Visible = -1, Me!PastDueLabel.Visible = 0).

Avick
03-17-2000, 05:03 AM
I have Tried this and i get an error message saying that the macro is not excessable. I haven't made a macro, I copyied the information in to the OnCurrent box like you said.This is the expression i used


Iif(Me!DueDate<Date(),Me!PastDueLable.Visible = -1,Me!PastDueLabel.Visible = 0)

The form is named "Acc Due"
Here are the fields i am working with
Date Field http://www.access-programmers.co.uk/ubb/biggrin.gifueDate
Label: PastDueLable

I have hidden the label like you said.

Mel Henderson
03-17-2000, 08:49 AM
Avick, here is how I can get a form to to what you asked for. It probly is the long way to get the job done but it will certainly work. First I added a new field to the table [Paid] and made it a Yes/No type data. On my form I created 2 text boxes and added the [Paid] field, in the control source for the first text box I put IiF([Due date]< Date()and [Paid]=0, "Days Pass Due"," ")
in the second text box I put IiF ([Due Date]< Date()and [Paid]=0,Date()-[Due Date]," ") Then I set the fonts to red, no borders, and back color the same as the form. If you put a check in the Paid box nothing shows up on your form in red, but if the check box is empty and the Due date has past it will show in red "5 Days Past Due" etc. Hope this is what you were looking for.

Avick
03-17-2000, 01:35 PM
That's perfect. It works better then what i was trying to do. The only thing is, i have one account that i left the check box blank to see what would happen and it gave me a figure of 411 when the due date was 31-Jan-99 how do i get round this. If i can't it's not a problem because i have a field that says past due any way. It looks great i only wish you could see it. Thanks a bunch.

This may help you.
The field that i have the due date in is based on a query on the order date + 30 days.
I don't know if this is of any use.

I think my face is going to crack I'm smiling that hard :-)

Mel Henderson
03-17-2000, 03:26 PM
Dont know why the 411 is coming up, check to see that the date entered is really a date and not a text entry. Also check that the PC has the correct date. Other then that cant think of anything else. If it a small data base and you want to e-mail it to me to look at its ok. My e-mail is mmorganny@aol.com I'm sure we can fix that problem.

Avick
03-18-2000, 11:09 AM
I have just looked at the numbers and its right. In my excitment at getting it working i never noticed that the due date is 13-Jan-99 and that would make the 411 right. the due date was over a year ago.

I am very sorry

Anyway i have to blame you for that, You got me so worked up that i could't see the wood for he trees. http://www.access-programmers.co.uk/ubb/smile.gif

I have showed it to 3 friends and they all think its great. (You got all the credit)

Thanks again Mel.

PS The database is 12mb and i am only running at 33bps.