M
Martin
I am using Allen Browne's tip that is available in his web site. However, I
get a compile error stating that the variable dbFailOnError is not defined. I
have search the MS Knowdledgeable base and found out the DBEngine (0)
(0).Execute is no longer used in current versions. I change it to the
following but I still get the same compile error message.
If Me.SF_Adjacencies.Form.RecordsetClone.RecordCount > 0 Then
strSql = "INSERT INTO [Adjacencies] ( DataRmID, AdjID,_
AdjRoomName, AdjRelevance ) " & _
"SELECT " & lngID & " As NewID, AdjID, AdjRoomName,_
AdjRelevance " & _
"FROM [Adjacencies] WHERE DataRmID = " & Me.DataRmID & ";"
CurrentDb().Execute strSql, dbFailOnError
Else
MsgBox "Main record duplicated, but there were no related
records."
End If
I have tried also adding
DIM dbs As DAO.Database
Set dbs=CurrentDB()
and substitute the line...
dbs.Execute strSQL, dbFailOnError
but the code will stop at DAO.Datase stating a compile error of User-Defined
type not defined.
Thank you.
get a compile error stating that the variable dbFailOnError is not defined. I
have search the MS Knowdledgeable base and found out the DBEngine (0)
(0).Execute is no longer used in current versions. I change it to the
following but I still get the same compile error message.
If Me.SF_Adjacencies.Form.RecordsetClone.RecordCount > 0 Then
strSql = "INSERT INTO [Adjacencies] ( DataRmID, AdjID,_
AdjRoomName, AdjRelevance ) " & _
"SELECT " & lngID & " As NewID, AdjID, AdjRoomName,_
AdjRelevance " & _
"FROM [Adjacencies] WHERE DataRmID = " & Me.DataRmID & ";"
CurrentDb().Execute strSql, dbFailOnError
Else
MsgBox "Main record duplicated, but there were no related
records."
End If
I have tried also adding
DIM dbs As DAO.Database
Set dbs=CurrentDB()
and substitute the line...
dbs.Execute strSQL, dbFailOnError
but the code will stop at DAO.Datase stating a compile error of User-Defined
type not defined.
Thank you.