Copy and paste a record, then clear certain fields

G

Guest

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!
 
G

Guest

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
 
T

Tim Ferguson

Each record contains:
[ID]
[DESCRIP1]
[AMOUNT1]
[DESCRIP2]
[AMOUNT2]
[DESCRIP3]
[AMOUNT3] ...and so on.

A structure like this is in sore need of a redesign. It really needs (at
least) two tables, one holding the MonthID (? and the Description) and the
other holding the SerialNumber(1,2,3, "and so on") and the Amount.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top