David627
10-28-2009, 12:05 PM
One of my users has a form that he uses for data entry. Sometimes the information in the form is used a second time (check is applied to more than 1 item, invoice same number, etc.) so he wants the record duplicated. I have the code that does that, however I can't get the form to end up on the newly replicated record on the form so he can alter it and proceed.
I've tried DoCmd.RunCommand acCmdRecordsGoToLast and DoCmd.GoToRecord , , acLast and noe have worked.
The rest of my code (which works) is:
Private Sub PBReplicate_Click()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.MoveLast
DoCmd.GoToRecord , , acNewRec
Me.[Entry Date] = rs![Entry Date].Value
Me.CHECK_NO = rs!CHECK_NO.Value
Me.[Entry Date] = rs![Entry Date].Value
Me.[Check Date] = rs![Check Date].Value
Me.PAYER = rs!PAYER.Value
Me.[Permit Fee] = rs![Permit Fee].Value
Me.Surcharge = rs!Surcharge.Value
Me.[Amendment Fee] = rs![Amendment Fee].Value
Me.[Configuration Fee] = rs![Configuration Fee].Value
Me.[Contiguous County Fee] = rs![Contiguous County Fee].Value
Me.[Permit Number] = rs![Permit Number].Value
Me.[Permit Type] = rs![Permit Type].Value
Me.[Permit Class] = rs![Permit Class].Value
Me.[RejectedAmendedCancelled] = rs![RejectedAmendedCancelled].Value
Me.USDOT = rs!USDOT.Value
rs.Close
Set re = Nothing
DoCmd.GoToRecord , , acLast
End Sub
Thanks,
David
Edited 29-Oct-09 by geekgirlau. Reason: add vba tags
I've tried DoCmd.RunCommand acCmdRecordsGoToLast and DoCmd.GoToRecord , , acLast and noe have worked.
The rest of my code (which works) is:
Private Sub PBReplicate_Click()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.MoveLast
DoCmd.GoToRecord , , acNewRec
Me.[Entry Date] = rs![Entry Date].Value
Me.CHECK_NO = rs!CHECK_NO.Value
Me.[Entry Date] = rs![Entry Date].Value
Me.[Check Date] = rs![Check Date].Value
Me.PAYER = rs!PAYER.Value
Me.[Permit Fee] = rs![Permit Fee].Value
Me.Surcharge = rs!Surcharge.Value
Me.[Amendment Fee] = rs![Amendment Fee].Value
Me.[Configuration Fee] = rs![Configuration Fee].Value
Me.[Contiguous County Fee] = rs![Contiguous County Fee].Value
Me.[Permit Number] = rs![Permit Number].Value
Me.[Permit Type] = rs![Permit Type].Value
Me.[Permit Class] = rs![Permit Class].Value
Me.[RejectedAmendedCancelled] = rs![RejectedAmendedCancelled].Value
Me.USDOT = rs!USDOT.Value
rs.Close
Set re = Nothing
DoCmd.GoToRecord , , acLast
End Sub
Thanks,
David
Edited 29-Oct-09 by geekgirlau. Reason: add vba tags