Hello All,
I am trying to get this to work. Basically, Im trying to copy the current records with the records of the subform and paste them in a new record.
I keep getting this error message "object doesn't support this property or method" It doesn't tell me where the error is or nothing???
What am I doing wrong?
Here is a simplified copy of the code.
I am trying to get this to work. Basically, Im trying to copy the current records with the records of the subform and paste them in a new record.
I keep getting this error message "object doesn't support this property or method" It doesn't tell me where the error is or nothing???
What am I doing wrong?
Here is a simplified copy of the code.
Code:
Dim dbs As Database, Rst As Recordset
Dim SRst As Recordset
Dim scompany As String
Dim saddress As String
'Subform fields
Dim sSequenceNumber As Long
Dim sSequenceDescription As String
On Error GoTo Err_btnDuplicate_Click
Set dbs = CurrentDb
Set Rst = Me.RecordsetClone
Set SRst = Me.RoutingSubform.Form.RecordsetClone
scompany = "" & Me!company
saddress = "" & Me!Address
'Subform Fields
sSequenceNumber = "" & Me!RoutingSubform!SequenceNumber
sSequenceDescription = "" & Me!RoutingSubform!SequenceDescription
With Rst
.AddNew
!company = scompany
!Address = saddress
'Subform fields
With SRst
.AddNew
!SequenceNumber = sSequenceNumber
!SequenceDescription = sSequenceDescription
.Update ' Save changes.
.Move 0, .LastModified
End With
Me.Bookmark = Rst.Bookmark
Exit_btnduplicate_Click:
Me.Refresh
Exit Sub
Err_btnDuplicate_Click:
MsgBox Error$
Resume Exit_btnduplicate_Click:
End With
End Sub