A date calculation and text enhancement

Robbyp2001

Registered User.
Local time
Today, 15:25
Joined
Oct 8, 2011
Messages
143
Hello Folks

First thing I'd like to say is that the help and advice I've received on here has been tremendous. Thank you all.

I have another question to ask of you, if I may.

My Library database has a continuous form, each form contains the book details and the [dateOut] (the date of the borrowing) and [dateIN] (the date the book is due to be returned). [dateOut] is set to Date() and is of course populated when the student borrows a book. [dateIN] is populated by calculating [dateOut]+7. So far no problems with that.

Could someone help me with the code behind a proposed TextBox on the same form that will show "Overdue" when the current date has gone beyond the [dateIN]. So, Date()>[dateIN]. When this event occurs I'd like the textbox to show "Overdue", otherwise it should remain invisible.

There is a possibility that I will extend the borrow time to Date()+14, so the code would have to be able to deal with that too.

I have thought that it would be helpful for the user if this "Overdue" flag was enhanced, say, Red Text, Bold and perhaps flashing if possible, making it as conspicuous as possible.

What do you think?

Many thanks

Rob
 
you can use conditional formatting, for font colour, bold, underline and italic and also back colour, but not flashing (for which many would argue there are potential health issues).

Suggest set the message etc as required, then in conditional formatting

Expression is....[Date In]>date()

then simple set the conditional formatting forecolour to the same as the back colour which effectively will hide the text.

Also recommend set the control properties enabled to false and locked to true
 
Many thanks CJ.

If I set the textbox to [Date In]>date() it returns a numerical value -1, -1, 0, 1, 2 etc depending on the date in [dateIN]. How, using conditional formatting do I get the textbox to display "Overdue" instead of this value?

I understand how to enhance the text box based on values greater than or less than etc. the value in the box, but this will only enhance the value displayed in the box (see above), which is of course, meaningless to the user.

I'd like it to take, for example, all values greater than 0, and display these as "Overdue" instead of whatever numeric value is in the box.
 
you are not using conditional formatting.

the control source for your textbox should be ="Overdue"

Don't know which version of access you are using, but assuming 2007 or later, in design view click on the format tab above the ribbon and then select conditional formatting
 

Users who are viewing this thread

Back
Top Bottom