Do you have these two lines at the top of EVERY code module??
Code:
Option Compare Database
Option Explicit
I reformatted your code - in doing so I found an error
Code:
Private Sub CMD_SAVE_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim strSQL As String
Dim varItem As Variant
Dim lookup As Integer
Dim emp As Integer
Dim trng As Integer
Set db = CurrentDb()
emp = Me.TXT_EMP.Column(2)
trng = Me.TXT_TR.Column(1)
lookup = DCount("[TRAINING]", "[EMP_TRNG_TBL]", "[TRNG_ID] =" & trng & " AND [EMP_ID] = " & emp)
If lookup = 0 Then
Set rs = db.OpenRecordset("EMP_TRNG_TBL", , AppendOnly)
Set ctl = Me.TXT_TR
For Each varItem In ctl.ItemsSelected
rs.AddNew
rs!training = ctl.ItemData(varItem)
rs!TRNG_ID = MeTXT_TR.Column(1) '<<<<----- missing a period after the ME !!!!
rs!EMP_ID = Me.TXT_EMP.Column(2)
rs.Update
Next varItem
Me.TXT_TR = Null
Else
MsgBox "Training already submitted"
End If
'clean up
rs.Close
Set rs = Nothing
Set ctl = Nothing
Set db = Nothing
End Sub
Should be
Code:
rs!TRNG_ID = Me.TXT_TR.Column(1)