Is it possible for me to bypass the error message #3604 'duplicate key was ignored'. When this error message is thrown it stops processing the subsequent stored procedures so just want it by-passed and not displayed to screen.
However I'd recommend first that you look at the Table you are quering as there must be good reason for the original error message i.e. you have set a field's properties, for good reason (?), to not allow duplicates so if you do want duplicates you would need to change this property. My original posting (above) will enable you to continue the Macro but NOT complete the affected query in which case the full purpose of the Macro will not be completed.
Basically the error is thrown by the mail_proc_beta stored procedure below which is a package of stored procedures. Any subsequent procedures are then obivously not run because of the error.
The error CAN be safely ignored I just need to know how.
Private Sub Command49_Click()
On Error GoTo Err_Command49_Click
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strSql As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryStoredProcNoRecReturn")
Select Case Frame24.Value
Case 1
strSql = "exec mail_proc_beta " & Me.Combo10
Case 2
strSql = "exec mail_email_beta " & Me.Combo10
Case 3
strSql = "exec mail_sms_beta " & Me.Combo10
End Select
However I'd recommend first that you look at the Table you are quering as there must be good reason for the original error message i.e. you have set a field's properties, for good reason (?), to not allow duplicates so if you do want duplicates you would need to change this property. My original posting (above) will enable you to continue the Macro but NOT complete the affected query in which case the full purpose of the Macro will not be completed.
Okay thanks I am at home now but will try this at work on Monday. As stated it is okay to ignore this error as the stored procedure has been well tested I just don't want Access throwing it.