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

Insert a record into another file

Status
Not open for further replies.

snowyowl

Programmer
Joined
Dec 16, 2002
Messages
16
Location
GB
Does anybody know the insert into statement in SQL that will copy a record from one file to another if the primary key value is known on an open form. At the moment I have

INSERT INTO [kpi copy]
SELECT *
FROM kpi
WHERE [id]=827;


This does not take me far enough to be able to copy a record from an active form and press a button.
 
DoCmd.RunSql "INSERT INTO [kpi copy] " & _
"SELECT * " & _
"FROM kpi " & _
"WHERE [id]= " & Me!PrimaryKeyField

Good luck

[pipe]
Daniel Vlas
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top