Run-time Error 3246 - Operation not supported in transactions

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Thanks for all the help yesterday with the code below.

When I try to requery the subform "frmnewpartssubform" I get a runtime error
3246- Operation not supported in transactions.
When I manually type part numbers in I do not get the error and the subform
is required ok

Can any one help me solve this?

Dave

Private Sub partno_BeforeUpdate(Cancel As Integer)
If IsNull(DLookup("[IZPN]", "tblpartsdatabase", "[IZPN] = '" & Me.partno &
"'")) Then
If MsgBox("This is a New Part - Do You Wish To Add?", vbYesNo, "Project
Costing Database") = vbNo Then
Cancel = True
Me.Undo
Exit Sub
Else: CurrentDb.Execute ("INSERT INTO tblnewparts ( partno, xfile,
issue )" & "Values('" & Me.partno & "', '" & Forms!frmprojectstabbed.Form! _
xfile & "', '" & Forms!frmprojectstabbed.Form!issue & "');"),
dbFailOnError
Cancel = True
Me.Undo
Forms!frmprojectstabbed!frmnewpartssubform.Form.Requery

End If
End If
 
This sounds like a timing issue.

If partno is a bound control, then there is an entry in progress. This event
has not been completed when you try to undo it and requery the form.
 
Thanks Allan

It seems to be a timing problem - if I remove the requiry event it works ok
(well apart from a "paste error" message"!!)
I have tried requerying using the After Update Event but get the same error.

Thanks

Dave


Allen Browne said:
This sounds like a timing issue.

If partno is a bound control, then there is an entry in progress. This
event has not been completed when you try to undo it and requery the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Dave said:
Thanks for all the help yesterday with the code below.

When I try to requery the subform "frmnewpartssubform" I get a runtime
error 3246- Operation not supported in transactions.
When I manually type part numbers in I do not get the error and the
subform is required ok

Can any one help me solve this?

Dave

Private Sub partno_BeforeUpdate(Cancel As Integer)
If IsNull(DLookup("[IZPN]", "tblpartsdatabase", "[IZPN] = '" & Me.partno
& "'")) Then
If MsgBox("This is a New Part - Do You Wish To Add?", vbYesNo,
"Project Costing Database") = vbNo Then
Cancel = True
Me.Undo
Exit Sub
Else: CurrentDb.Execute ("INSERT INTO tblnewparts ( partno, xfile,
issue )" & "Values('" & Me.partno & "', '" &
Forms!frmprojectstabbed.Form! _
xfile & "', '" & Forms!frmprojectstabbed.Form!issue & "');"),
dbFailOnError
Cancel = True
Me.Undo
Forms!frmprojectstabbed!frmnewpartssubform.Form.Requery

End If
End If
 
Back
Top