'---------------------------------------------------------------------------------------
' Procedure : btnHasQuality_Click
' Author :
' Date : 28-11-2011
' Purpose : To populate PersonHasQualitiesTable with
' the id of the Person and the id of the Quality involved.
'Unique index on PersonId & QualityId to prevent duplicates.
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'--------------------------------------------------------------------------
'
Private Sub btnHasQuality_Click()
On Error GoTo btnHasQuality_Click_Error
On Error GoTo Err_btnHasQuality_Click
Dim SQL As String
SQL = "Insert Into PersonHasQualitiesTable(PersonId,QualityId) " _
& "VALUES (" & Me.txboxUser & "," & Me.cboQuality & ")"
Debug.Print SQL
CurrentDb.Execute SQL, dbFailOnError
Exit_btnHasQuality_Click:
Exit Sub
Err_btnHasQuality_Click:
MsgBox Err.Description
Resume Exit_btnHasQuality_Click
On Error GoTo 0
Exit Sub
btnHasQuality_Click_Error:
MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure btnHasQuality_Click of VBA Document Form_frmPersonHasQuality"
End Sub