View Single Post
  #17  
Old August 19th, 2004, 01:11 PM
Brendan Reynolds
external usenet poster
 
Posts: n/a
Default

In the real world, Boris, you're hardly going to be adding a record and then
immediately deleting it again? There doesn't seem to be much point in
investigating that particular situation much further, because it doesn't
seem to be a realistic situation - what works in that artificial situation
may not work under real world conditions. I understand your desire to
simplify, but perhaps we need to get a bit closer to the real-world
situation in order to make any further progress?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


"Boris" wrote in message
...
Brendan Reynolds wrote:
Well, you've got my curiositly going now! So I tried changing the code
behind the command button as follows, (I've left the original ADO
code in there, but commented out) and sure enough the error
disappears ...

Private Sub cmdButton_Click()
'Dim adoCmd As New ADODB.Command

'adoCmd.ActiveConnection = CurrentProject.Connection
'adoCmd.CommandType = adCmdText

'adoCmd.CommandText = "INSERT INTO tblB ([ID], [fkA]) VALUES(1,
1)" 'adoCmd.Execute Options:=adExecuteNoRecords
CurrentDb.Execute "INSERT INTO tblB (ID, fkA) VALUES (1, 1)",
dbFailOnError
Me![subform].Requery

'adoCmd.CommandText = "DELETE FROM tblB WHERE [ID] = 1"
'adoCmd.Execute Options:=adExecuteNoRecords
CurrentDb.Execute "DELETE FROM tblB WHERE ID = 1", dbFailOnError
Me![subform].Requery
End Sub


The error also disappears when you use the ADO code and comment one of the
two Me![subform].Requery lines.
Still trying to figure out what goes wrong ...

Boris

[...]