Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmdCloseApp_Click()
On Error GoTo Err_cmdCloseApp_Click
Dim adConn As ADODB.Connection
Dim strsql1 As String
Dim strsql2 As String
Dim nRecordsTraining As Long
Dim nRecordsAccreditation As Long
Set adConn = New ADODB.Connection
adConn.Open CurrentProject.Connection
strsql1 = "INSERT INTO Trainingtbl (TrainingID, FirstName, LastName) " & _
"Select ContactID, FirstName, LastName " & _
"From Contactstbl C LEFT JOIN Trainingtbl T " & _
" ON C.ContactID = T.TrainingID " & _
"Where T.TrainingID IS NULL;"
strsql2 = "INSERT INTO Accreditationtbl (AccreditationID, FirstName, LastName) " & _
"Select ContactID, FirstName, LastName " & _
"From Contactstbl C LEFT JOIN Accreditationtbl A " & _
" ON C.ContactID = A.AccreditationID " & _
"Where A.AccreditationID IS NULL;"
adConn.Execute strsql1, nRecordsTraining
adConn.Execute strsql2, nRecordsAccreditation
MsgBox nRecordsTraining & " records Added to Training" & vbCrLf & _
nRecordsAccreditation & " records Added to Accreditation", _
vbInformation, "Additions Complete"
Exit_cmdCloseApp_Click:
Set adConn = Nothing
Exit Sub
Err_cmdCloseApp_Click:
MsgBox Err.Description
Resume Exit_cmdCloseApp_Click
End Sub