Access_Help
Registered User.
- Local time
- Today, 06:16
- Joined
- Feb 12, 2005
- Messages
- 136
Can someone please help me place the customised 3022 message into this code as it is still defaulting to the original msg
Code:
Dim rst As DAO.Recordset
Dim varItm As Variant
Set rst = CurrentDb.OpenRecordset("tbl_assignSessions", dbOpenDynaset)
For Each varItm In List41.ItemsSelected
With rst
.AddNew
![ExamAssign] = [tbl_assignSessions Subform].[Form]![ExamAssign]
![Session] = List41.Column(3, varItm)
![Initials] = List41.Column(0, varItm)
.Update
If Err.Number = 3022 Then
MsgBox "That combination already exists, try again"
Else
MsgBox Err.Num & " " & Err.Description
End If
End With
Next varItm
rst.Close
Set rst = Nothing
Forms![tbl_Exams]![tbl_assignSessions Subform].Requery
End Sub