Link to home
Start Free TrialLog in
Avatar of hcp27
hcp27Flag for United States of America

asked on

Duplicate Form Record

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!
Avatar of RemRemRem
RemRemRem
Flag of United States of America image

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
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
Avatar of hcp27

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of MINDSUPERB
MINDSUPERB
Flag of Kuwait image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hcp27

ASKER

Stellar!!!!