Good day folks,
I have an inventory DB that generates current inventory by comparing two tables, "Item Purchases" and "Returns".
During the form entry of Item Purchases, I would like to duplicate the record N times, where N is equal to the QTY of items on the form.
I would like to incorporate the duplication into my "Commit Record" macro.
What are the arguments for the DoCmd.CopyObject and DoCmd.SaveRecord?
DoCmd.CopyObject (DestinationDatabase, NewName, SourceObjectType, SourceObjectName)
DoCmd.Save (ObjectType, ObjectName)
Macro
Call DupRecord(QTY)
MessageBox -> "Record Saved"
Sub DupRecord(QTY) '<------ How do I pass the QTY from the Item Purchase Form to the subroutine DupRecord?
Dim i As Integer
i = 0
Do While (True)
DoCmd.CopyObject '<------ How to duplicate a multifield record into the Purchases table?
DoCmd.SaveRecord '<----- How to save the record?
i = i + 1
If i > QTY Then Exit Do
Loop
End Sub
This would be my first implementation of a subroutine. Any suggestions on implementation are welcome.
Thanks for the advice!!
Darrell
I have an inventory DB that generates current inventory by comparing two tables, "Item Purchases" and "Returns".
During the form entry of Item Purchases, I would like to duplicate the record N times, where N is equal to the QTY of items on the form.
I would like to incorporate the duplication into my "Commit Record" macro.
What are the arguments for the DoCmd.CopyObject and DoCmd.SaveRecord?
DoCmd.CopyObject (DestinationDatabase, NewName, SourceObjectType, SourceObjectName)
DoCmd.Save (ObjectType, ObjectName)
Macro
Call DupRecord(QTY)
MessageBox -> "Record Saved"
Sub DupRecord(QTY) '<------ How do I pass the QTY from the Item Purchase Form to the subroutine DupRecord?
Dim i As Integer
i = 0
Do While (True)
DoCmd.CopyObject '<------ How to duplicate a multifield record into the Purchases table?
DoCmd.SaveRecord '<----- How to save the record?
i = i + 1
If i > QTY Then Exit Do
Loop
End Sub
This would be my first implementation of a subroutine. Any suggestions on implementation are welcome.
Thanks for the advice!!
Darrell