F1racer
F1racer

Reputation: 5

Access: Mark entries based on text box on form

I have a database of tasks with deadlines and some other data.

The tasks are presented row by row as a continous "detail" on a form. In the same form there is a textbox where the user can enter a date.

Now I want the date in the textbox to be compared to the deadline of each task and one of five checkbox be checked depending on how far from the entered date the deadline is set: If the deadline is today; check checkbox1 If the deadline is tomorrow; check checkbox2 and so on...

Multiple people may be viewing the database at the same time with different dates entered.

Upvotes: 0

Views: 52

Answers (1)

Minty
Minty

Reputation: 1626

Not easily without seeing your expected inputs and outputs, but lets keep it simple. Assume you wanted to to simply say 1 day was light green, 2 dark green, etc 5 or over was Red. Add a field to your query that counts the days difference between you textbox and the deadline. So your new field we'll call NoOfDays and it should look something like;

NoOFDays: DateDiff("d",[YuodDeadLineField] ,[Forms]![YourFormName]![YourTextBox])

Now on your form add a textbox to display this. Then in the conditional formatting change the colour of either the text , or background or both depending on it's value. You could hide the text if you just want the colour.

You might want to add a requery to the after update code of the unbound text box in your form header.

Upvotes: 1

Related Questions