Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Duplicate Form Record

Posted on 2011-03-11
5
Medium Priority
?
268 Views
Last Modified: 2012-06-22
Good afternoon,


I am almost done with a product of mine and the end user has suggested a fix for a potential long term problem. I have a command located on my form that "duplicates the records". When duplicating, this helps the user quickly add a new record that is similar to some one of the old records.

What I would like to see happen, is clear some of the data fields after the duplication automatically. For instance, on ever record, I need to change the PO#. I would like the form to duplicate and then delete the PO Number that is also duplicated. Is this possible? I have many items I would like to clear not just the PO#.

Any suggestions on how to get this done?

Any help would be much appreciated!

Thanks!
0
Comment
Question by:hcp27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:RemRemRem
ID: 35113904
The button that does the copying can have code added after the creation of a new record:

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
    Me.<fieldname> = ""
    Me.<otherfieldfieldname> = ""

Note - if the <fieldname> field is a required field, you'll need to put something in it - if numeric, that might be just a "0" value, for example
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 35114468
hcp27,

I may suggest to post the code you use on how your records are duplicated. We would be able to do a tweak of the code to resolve your issue.

Sincerely,
Ed
0
 

Author Comment

by:hcp27
ID: 35128900
Mind Superb,

I simply used the duplicate record on the button wizard. Nothing fancy.

Rem Rem,


if i used the mentioned wizard above can i still use that code?
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 2000 total points
ID: 35129101
Put this code on the click event of the button:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Me.PO#=""


Sincerely,
Ed
0
 

Author Closing Comment

by:hcp27
ID: 35129174
Stellar!!!!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question