I am trying to insert a post which already exist. If it exists i don't want to write the post in the table.
Doing this is by select case in errorhandler
My problem is that i don't get a chance to taking care of the sql-error code since i am doing DoCmd.RunSQL (strSQL).
The sql-code:
strSQL = "INSERT INTO Rapp_Temp"
strSQL = strSQL & " ([ID-PROJEKTDELTAGARE], [DA-AR], [ID-AKTIVITET], [ID-PROJEKT], [BE-PROJEKT], [BE-AKTIVITET])"
strSQL = strSQL & " VALUES (" & TidrappTab(ixa, 2) & ", " & TidrappTab(ixa, 6) & ", " & TidrappTab(ixa, 1) & ","
strSQL = strSQL & " " & id_proj & ", '" & be_proj & "', '" & be_akt & "');"
DoCmd.RunSQL (strSQL)
When i use
Set qdf = dbThis.CreateQueryDef("", strSQL)
Set rst = qdf.OpenRecordset(dbOpenSnapshot)
i came to errorhandler where i can use
errorhandler:
Select Case Err.Number
Case 3021
plantemp_koll = 0
Resume Next
Case Else
MsgBox "Error="
Anyone knowing how to handle "post exists" and then continuing with next post?
Thanks