View Single Post
  #15  
Old August 19th, 2004, 12:50 PM
Boris
external usenet poster
 
Posts: n/a
Default

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

[...]