Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

daveinchicago (IS/IT--Management) (OP)
21 Feb 12 17:03
If Not (Me.RLCatssubform1.Form.Recordset.EOF And Me.RLCatssubform1.Form.Recordset.BOF) Then
If MsgBox("Are you sure you want to Delete?", vbYesNo) = vbYes Then
CurrentDb.Execute "Delete from dbo_COMPLIANCE_RESTR_CATEG " & _
"where ID=" & Me.RLCatssubform1.Form.Recordset.Fields("ID"), dbFailOnError + dbSeeChanges
Me.RLCatssubform1.Form.Requery
End If
End If


I've got the above code tied to a button in Access 2010.  The subform is a SQL Table.  When I highlight a row in the subform (SQL Table) and hit the 'delete' button, the row should delete.  However, I am getting a
Run-Time error '3622'  You must use dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column.

I am clearly using dbSeeChanges so I'm not sure what the problem is.  Any help is greatly appreciated.
 
daveinchicago (IS/IT--Management) (OP)
21 Feb 12 18:36
Hi.  I changed the code to the following and now working great!!

If Not (Me.RLCatssubform1.Form.Recordset.EOF And Me.RLCatssubform1.Form.Recordset.BOF) Then
If MsgBox("Are you sure you want to Delete?", vbYesNo) = vbYes Then
SQ = "DELETE FROM dbo_COMPLIANCE_RESTR_CATEG WHERE ID = " & Me.RLCatssubform1.Form.Recordset.ID & ";"
DoCmd.SetWarnings (warningsoff)
 DoCmd.RunSQL (SQ), dbFailOnError Or dbSeeChanges

Me.RLCatssubform1.Form.Requery
sfJustCats.Form.Requery

End If
End If
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close