Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate records and erase fields

Status
Not open for further replies.

jjb373

MIS
Feb 4, 2005
95
US
On my form, I have a duplicate button with the following code:
Private Sub btnDuplicate_Click()
On Error GoTo Err_btnDuplicate_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, ,cMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_btnDuplicate_Click:
Exit Sub

Err_btnDuplicate_Click:
MsgBox Err.Description
Resume Exit_btnDuplicate_Click

End Sub


This duplicate button works great.
The record I duplicate has the following fields:
Person Name, Person ID, Appointment Date, document1, document2, document3, received (this is a checkbox).

I want to add code that when the record is duplicated, the data is erased in fields document1, document2, and document3.
***I only want to erase the data from these 3 fields in the newly created duplicate record.

Thanks for your input!
 
After the Paste/Append:
Me!document1 = ""
Me!document2 = ""
Me!document3 = ""
Me!document1.SetFocus

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top