I'm on my way on creating a simple Database for a company. This database contains several tables, one of the tables will record information about the training that had been completed by each employee. There are about ten sections of training that should be completed.
Regarding to the database, I have two tables called 'Development' and 'CSA_Lisence'. 'Development' is the table that record the information about training which containing ten checkboxes (which represent ten sections of training) and CSA_Lisence will be automatically requeried when the checkboxes on Development are fully checked.
Here's the step I've been worked on :
First, I made a function called 'CheckCompletion' to ensure whether all the checkboxes are checked :
Expand|Select|Wrap|Line Numbers
- Public Function CheckCompletion() As Boolean
- Dim blnComplete As Boolean
- Dim strCompletionSummary As String
- strCompletionSummary = Basic_Inspection & Certifying_Staff & Safety_Management_System & Regulation_Part_145 & Part_M & EWIS & Fuel_Tank_Safety_Level_2 & Dangerous_Goods & Human_Factor & Basic_Supervisory_Training
- If strCompletionSummary = "1111111111" Then
- blnComplete = True
- Else
- blnComplete = False
- End If
- End Function
Expand|Select|Wrap|Line Numbers
- Public Function UpdateEmployee()
- Dim emp_numb As Long
- Dim emp_name As Long
- Dim strsql As String
- emp_numb = [Forms]![development].[employee_number].Value
- emp_name = [Forms]![development].[employee_name].Value
- If CheckCompletion Then
- strsql = "INSERT INTO CSA_Lisence (employee_number, employee_name) VALUES (" & emp_numb & " , " & emp_name & " )"
- CurrentDb.Execute strsql
- End If
- End Function
Expand|Select|Wrap|Line Numbers
- Private Sub Basic_Inspection_AfterUpdate()
- Call UpdateEmployee
- End Sub
-deamond-