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

copy data

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi all,

CouldI have some advice on this please.
I have a form with the following code;
SELECT tblscheduler.Sch, tblscheduler.StaffID, tblscheduler.SLastname, tblscheduler.SFirstname, tblscheduler.SchDate, tblscheduler.SchNo, tblscheduler.T0500, tblscheduler.T0530, tblscheduler.T0600, tblscheduler.T0630,Format([SchDate],"dddd") AS Expr1,
FROM tblscheduler
WHERE (((tblscheduler.StaffID)=[forms]![form127]![frmStaffScheduler].[form]![StaffID]) AND ((tblscheduler.SchDate) Between [forms]![form127]![txtStartDate] And [forms]![form127]![txtendDate]) AND ((Format([SchDate],"dddd"))="Monday"))
ORDER BY tblscheduler.SchDate;

I want to copy data entered into another form with this code;
SELECT tblscheduler.Sch, tblscheduler.StaffID, tblscheduler.SLastname, tblscheduler.SFirstname, tblscheduler.SchDate, tblscheduler.SchNo, tblscheduler.T0500, tblscheduler.T0530, tblscheduler.T0600, tblscheduler.T0630, Format([SchDate],"dddd") AS Expr1,
FROM tblscheduler
WHERE (((tblscheduler.StaffID)=[forms]![form127]![frmStaffScheduler].[form]![StaffID]) AND ((tblscheduler.SchDate) Between [forms]![form127]![txtStartDate] And [forms]![form127]![txtendDate]) AND ((Format([SchDate],"dddd"))="Tuesday"))
ORDER BY tblscheduler.SchDate;

Perhaps using a command button to insert the data


Many thanks,kp














 
A select query will only read data. To append it to another table, you need to add an INSERT line at the top with the fields, and also to restrict the select component to the current record by ensuring the primary key value is part of the WHERE clause.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top