PC Review


Reply
Thread Tools Rate Thread

Copy and paste a record, then clear certain fields

 
 
=?Utf-8?B?VGltVA==?=
Guest
Posts: n/a
 
      23rd Jun 2005
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!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      23rd Jun 2005
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!

 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      23rd Jun 2005
"=?Utf-8?B?VGltVA==?=" <(E-Mail Removed)> wrote in
news:4DD6ACFB-B8F7-4BAB-AB57-(E-Mail Removed):

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with macro to copy, paste, and clear cell values Anthony Microsoft Excel Misc 8 21st Dec 2009 02:11 PM
Re: VBA copy clear paste Don Guillett Microsoft Excel Programming 0 18th Sep 2009 10:31 PM
Re: VBA copy clear paste Homey Microsoft Excel Programming 0 18th Sep 2009 08:54 PM
Macro help - copy row, clear, and paste on different sheet miker1999 Microsoft Excel Programming 3 1st Feb 2004 03:22 AM
clear, copy and paste Richard Leclezio Microsoft Excel Programming 4 12th Sep 2003 05:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:15 AM.