How to Create a Pop –Up Message before Task Due

Now because there is a cialis no prescription cheap greater absorption of blood cholesterol. The hormonal level is the best in the morning so, it is considered as the best time diagnosis. sildenafil online without prescription One should also spend plenty of time in sunlight purchase viagra online browse around to find out more too as it helps in the production of Vitamin D never face any problems related to the impotence drug. Potential causes of this abnormal condition in women could be growth in the cervix or uterus, vaginal dryness, fluctuating hormones, miscarriage, or cancer among other causes. cialis generika appalachianmagazine.com


Create a Pop –Up Message before Task Due

In this how to I will show how to create a Pop-Up Message before task due or over due or a message center before or when task overdue. For example before, when users log in database they will get a pop-up message if they have task due in next 5 days. I will use table Employee and TaskDue.

Follow the Step below:

Step #1 Create two table: Employee and TaskDue tables
  1. Employee table is the employee information.
  2. TaskDue table is the collection of all tasks with their information such as task name, task start date, end date and the assigned employee.

Each task will be assigned to the employee to process the task. Each employee maybe assigned more than one task which is called One-To-Many relationship of Employee to Task as shown in the picture below. Create two tables with field names similar the picture. On TaskDue table, create a lookup field EmpName to lookup the EmpID and EmpName from the Employee table. More info on How to Create Table here and How to Create Lookup Field here.

relationship employee to task

Step #2  Enter Data into Employee and TaskDue tables

The picture below is the sample data on Employee table. The LoginID field is a network or computer user login ID . For this example, I will not use a LoginID from a Login Form, but will use the computer user loginID by function Environ(“UserName”). A data type of this LoginID field is text.

employee data

The picture below is the sample data on TaskDue table. The EmpName field is a lookup field that selects employee name from the Employee table to assign the task for. Each task will have one employee assigned to. The data type of this EmpName field in Employee table is Number. More information at: How to Create Lookup Field here.

select emp from lookup

Step #3 Create Get LoginID Function

Each employee has a unique login ID from a network loginID on the LoginID(text) field on Employee table. However, the value of EmpName field on the TaskDue table is “number” as it is a Lookup field to EmpID in Employee table. We will need to create a function that gets the value of EmpID for the current logged in user. So we can compare that user to the TaskDue table if that user has a task due or due in 5 days.

Get Login ID Function:

Per function below, if the UserLogin = jsmith then result from this function will be 5 refer to employee table above.

get user login ID function

Step #4 Create Query
  • Create a query to display only the tasks that will due in 5 days
  • Name it as TaskDueIn5Day query
  • Under the query design view, insert TaskDue and Employee tables
  • Insert the fields in the query as similar in the picture below
  • Type function GetEmployeeID() on the Criteria row of field EmpName
  • Create a new calculated field of number of days before task due NumDay: [duedate]-Date()
  • Type Between 1 and 5 on the Criteria row of field NumDay field

query design

SQL:

Under the SQL View of query, you will see the SQL code below representing the query above. The developer can also write SQL code for the query instead of using the query builder above.

SELECT TaskDue.taskid, TaskDue.TaskName, TaskDue.StartDate, TaskDue.Duedate, TaskDue.EmpName, [duedate]-Date() AS NumDay, tbl_Employee.Email, TaskDue.DateEmailSent
FROM tbl_Employee INNER JOIN TaskDue ON tbl_Employee.EmpID = TaskDue.EmpName
WHERE (((TaskDue.EmpName)=GetEmployeeID()) AND (([duedate]-Date()) Between 1 And 5));

 Query View:

After completing the query in the design view, the result of query will display only one record that matches my User LoginID (Tewan) and Numday =2 (2 days before due) there is only task due for me.

query 5 day

Step #5 Create Alert Form
  • Create the alert form and name it “Task Due Alert”
  • Add a label on form with a message “You have a task due within 5 days. Please process this task before due date.”

pop up form

VB Code:

Put the code below under the Form On Load event of your first loaded form. We use Dcount function to check if there is a task due in the query “TaskDuein5Days” then open form “Task Due Alert.” If there is no task due or no record in the query the form “Task Due Alert” will not open.

Private Sub Form_Load()
If DCount("taskid", "TaskDuein5Days") > 0 Then
     DoCmd.OpenForm "Task Due Alert"
End If   
End Sub

Message Center:

A message Center is an alternate way to notify users when they have task due. We will need the query “TaskDuein5Days” same as above, but we will use it as a data source of subform then display the subform in the main message center to show a list of task due. Each user will see his or her own task due on the message center form as shown below.

Main menu message center



Related posts