When a user clicks OK on form "SelectDefaults," I want to open form "Welcome" if the results of query "qry_todo_overdue" = 0 or form "OverdueToDo" if the results >= 1. First, I assume that I need to run the query in "SelectDefault's" OnOpen event, right? But having done that, I'm not sure how to incorporate the query-checking into an If...Then statement on the OK button's OnClick event.
Here is the query's SQL:
SELECT Count(*) AS Expr1
FROM tbl_tasklist
WHERE (((tbl_tasklist.ptsk_duedate)<Date()) AND ((tbl_tasklist.ptsk_assigned)=[Forms]![SelectDefaults]![User]));
On a related note, and you may prefer this to be a separate thread, I want to show or hide a button on a form ("iScope") based on the results of a query ("qry_todos_for_issue"). Here is that SQL:
SELECT Count(*) AS Expr1
FROM tbl_tasklist
WHERE (((tbl_tasklist.ptsk_issue)=[Forms]![iScope]![issue]));
Again, I assume the first step is to run "qry_todos_for_issue" in "iScope's" OnOpen event. I guess I also need to run it in the OnCurrent event for when users open a different record while the form is still open? And then, I also don't know how to incorporate the query-checking into the button's code to determine the Visible property.
If there is an altogether better way to accomplish either of these things other than with a query, I would love to know. Any help is much appreciated, as always!
Leigh