Created
June 17, 2020 20:50
-
-
Save robwelan/bbf9ee67c8e7dd856ae5e224a7f7387e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub DoWork_LookupTables() | |
Dim rsCheck As DAO.Recordset | |
Dim varMsg As Variant | |
Dim lngResult As Long | |
Dim strSQL As String | |
On Error GoTo handle_Error | |
// Check Applicant Country | |
Set rsCheck = Nothing | |
strSQL$ = ReturnStandardQuery$("Count_ExistingApplicantCountryInCountries") | |
Set rsCheck = CurrentDb.OpenRecordset(strSQL$) | |
If rsCheck.Fields.Count = 1 Then | |
lngResult& = rsCheck.Fields(0) | |
If lngResult& = 0 Then | |
strSQL$ = ReturnStandardQuery$("Insert_ApplicantCountryInCountries") | |
If ExecuteSQL(strSQL$) = False Then | |
varMsg = MsgBox("It was not possible to insert the Applicant's Country Name into the tblCountries table. You will need to seek support.", vbOKOnly, "ERROR: Insert Applicant Country...") | |
GoTo exit_Gracefully | |
End If ' ExecuteSQL(strSQL$) = False | |
End If ' lngResult& = 0 | |
Else | |
varMsg = MsgBox("The wrong number of records was returned from the 'Count_ExistingApplicantCountryInCountries' query. Seek Support.", vbOKOnly, "ERROR: Returned Data Invalid...") | |
GoTo exit_Gracefully | |
End If ' rsCheck.Fields.Count = 1 | |
... | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment