Change to red when Payment is Overdue

Avick

Registered User.
Local time
Today, 04:58
Joined
Mar 11, 2000
Messages
49
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.
????
 
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).
 
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
biggrin.gif
ueDate
Label: PastDueLable

I have hidden the label like you said.
 
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.
 
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 :-)
 
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.
 
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.
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.
 

Users who are viewing this thread

Back
Top Bottom