I like to use a variable for the SQL so I can see what the SQL statement looks like:
Code:
Private Sub cmdAdd_Click()
Dim sSQL As String
If Me.txtID.Tag & "" = "" Then
sSQL = "INSERT INTO recEmpEC(EmployeeID, PrmEngConName, Relationship, PrmPhNumber, [Hm/Cell/Wk], 2ndPhNumber, [2ndHm/Cell/Wk])"
sSQL = sSQL & " VALUES (" & Me.txtID & ", " & Me.txtPrmEngCon & ", " & Me.cboRel & ", " & Me.txtPrmPhNum & ", " & Me.cboHmCellWk1 & ", " & Me.txtSecPhNum & ", " & Me.cboHmCellWk2 & ")"
'for debugging
Debug.Print sSQL
CurrentDb.Execute sSQL, dbFailOnError
Else
sSQL = "UPDATE recEmpEC Set EmployeeID = " & Me.txtID & ", PrmEngConName = " & Me.txtPrmEngCon & ", Relationship = " & Me.cboRel & ","
sSQL = sSQL & " PrmPhNumber = " & Me.txtPrmPhNum & ", [Hm/Cell/Wk] = " & Me.cboHmCellWk1 & ","
sSQL = sSQL & " 2ndPhNumber = " & Me.txtSecPhNum & ", [2ndHm/Cell/Wk] = " & Me.cboHmCellWk2
sSQL = sSQL & " WHERE EmployeeID = " & Me.txtID.Tag
'for debugging
Debug.Print sSQL
CurrentDb.Execute sSQL, dbFailOnError
End If
cmdClear_Click
subfrmEmpEC.Form.Requery
End Sub
Set a breakpoint and see what the SQL looks like.
Do you have the correct delimiters??
Warning: I might have missed something when I retyped this