Append current record on Form to another table

lcboley

Registered User.
Local time
Today, 16:57
Joined
Oct 1, 2004
Messages
13
I have a table lead_information and a table sold_jobs. I want to put a sold button on the form for lead_information. I want the sold button to append the current record to the sold_jobs table. The fields in each table are the same except for the sold_jobs table has fields that the lead_information table does not.

It would be nice to have it open the sold_jobs form after it appends the data.

Any help would be appreciated.

Thanks.
 
the way i think you would need to do this is quite simple, fistly you would need to create an append query as you said, which would look at the IDNumber of the records that you wish to move. IF you need help iwth this, let me know the name of the form, the IDNumber field, and the name of the tables, and few of the fields. So i can show you how to do the rest.


Next delete the current record

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Then open the form of the sold_jobs.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form_Name"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Hope this helps.

It would get a bit more complex if you use subforms etc.
 
M8KWR said:
Next delete the current record

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

That code has been obsolete since Access 95 and has been superceded by the following method:

Code:
DoCmd.RunCommand acCmdDeleteRecord
 
I dont currently have an ID field in my Lead_information table. I can put one in.

Also I dont know that I want to delete the record from the lead_information table.

The form name is Lead_information and the form for sold_jobs table is sold_jobs.

I have no subforms.
 

Users who are viewing this thread

Back
Top Bottom