I am trying to duplicate a main form's record and records from the subform or child table.
When I run the following code the form should move to the new record and supply the DuplicateOrderDetails Apend query with the new Account code. But The form stays on the current record and just copies the data to the same data set?
Dim dbs As DAO.Database, rst As DAO.Recordset
Me.txtAccountCode = Me.AccountCode
Me.txtItemNumber = Me.Details.Form.ItemNumber
' Return Database variable pointing to current database.
Set dbs = CurrentDb
Set rst = Me.RecordsetClone
'On Error GoTo Err_btnDuplicate_Click
' Tag property to be used later by the append query.
Me.Tag = Me![AccountCode]
' Add new record to end of Recordset object.
!CustomerName = Me!CustomerName
!ProjectRef = Me!ProjectRef & " B"
!Phone = Me!Phone
!Fax = Me!Fax
!Email = Me!Email
!Ref = Me!Ref
!OrderNumber = Me!OrderNumber
!CustomerOrderNumber = Me!CustomerOrderNumber
'!DateCreatedProject = Me!TodaysDate
.UpDate ' Save changes.
.Move 0, .LastModified
MsgBox "new account code is " & [txtAccountCode]
Me.Bookmark = rst.Bookmark
I am pretty sure that the Tag property is redundent code.
Also on occation I get chinese writing in my tables. See attached