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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Partially Duplicating a record

Status
Not open for further replies.

dpye

Technical User
Mar 24, 2003
31
0
0
CA
Hey,

I've been working a database that essentially schedules calls. As a result we will inevitably have to reschedule calls for certain customers. Rather than modify the existing schedule record I want to record this as 2 separate records but have most of the information from the first schedule record carried forward to the second scheduled record and perhaps increment a call attempt field by 1. Wow that's a lot of use of the word record :)

I've created a button with the following event but this takes everything over to a new record. I haven't figured out how to have have a field increment by 1. How can I selectively choose what fields come across to the new record and what would be the best way to have field increment each time?
------------------------------------------------------------
On Error GoTo Err_cmdReschedule_Click


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

Exit_cmdReschedule_Click:
Exit Sub

Err_cmdReschedule_Click:
MsgBox Err.Description
Resume Exit_cmdReschedule_Click
------------------------------------------------------------

Thanks.
 
First, I'd replace the DoMenuItem calls with RunCommand calls (Microsoft encourages this for version independence, and it's better self-documenting code anyway):
RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

Next, I'd add code to set the controls you don't want to copy to Null:
txtCallDate = Null
txtCallTime = Null
etc.

How does that sound?

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top