Try this code when you click the button
' To copy the current record to a new record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
' To remove the values from the amounts
Me.AMOUNT1 = 0
Me.AMOUNT2 = 0
Me.AMOUNT3 = 0
"TimT" wrote:
> I designed this database were the information in certain fields of a record
> would need to stay the same and I would like to create a button to copy the
> current record and append it to the same table, then clear certain fields.
> For example:
> Each record contains:
> [ID]
> [DESCRIP1]
> [AMOUNT1]
> [DESCRIP2]
> [AMOUNT2]
> [DESCRIP3]
> [AMOUNT3] ...and so on.
> Each record reflects one month and the description needs to stay consistant
> from month to month and the amount will get updated.
> So when a new month needs to be entered I would like to use code to "roll
> the current record over" leaving the amount field blank for updating.
> Can someone help me with the way the code should look?
> Thanks for any help!
|