So...clicking the Category 1 button sets a global to Category 1, and that establishes a relationship to Category 1 tasks in the Tasks table? Something like that? And if an employee has tasks for Categories 1, 3, 5, you want buttons 1, 3, 5 to look available and buttons 2, 4 to be grayed out (or something like that)?
Yes. Otherwise you would have to click every button to see if there were any tasks in that category to complete. Not a huge problem but an opportunity for things to get missed.
Depending on what you're using for buttons, you could conditionally format them based upon an ExecuteSQL formula, or you could hide them as needed.
Using Conditional Formatting on each button, your ExecuteSQL might look something like:
ExecuteSQL ( "select COUNT(T.TaskID) from Tasks T where T.Category = ? AND T.kf_SerialNumber = ?"; ""; ""; 1 ; EmployeeProjects::kP_SerialNumber )
You'd modify the part near the end, changing "1" to "2", etc., so you'd have 5 similar statements.
Becoming more familiar with SQL has been on my do to list for a while so it looks like now might be a good time. I will give it a shot. Thanks.
If you copy and paste my formula, and modify it so your tables and categories replace what I put in, it ought to work. Just replace my table names with yours and so on.
Also, name each button. At then end of your script which sets the global, issue a commit, then a Refresh Object for that button. Otherwise the ExecuteSQL may not re-evaluate on its own.
I'll give it a try