How can I duplicate (on demand) a number of records?

M

Mark Pilbeam

I have a form, attached to a table which stores records for an Operators
work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record, in a
form, and have all of the records of the Operator duplicated as new records?
This would mean that at the beginning of each week I could easily reproduce
the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

Grateful,

Mark
 
M

Mike Painter

Mark said:
I have a form, attached to a table which stores records for an
Operators work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record,
in a form, and have all of the records of the Operator duplicated as
new records? This would mean that at the beginning of each week I
could easily reproduce the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

You could create a table with the times and use an append query to add
records using forms!YourFormName!WeekNumber and
forms!YourFormName!EmployeeID
 
G

Guest

Mark,

I would do this with a query to locate the schedules of all operators for
the previous week, then append the new recordset back to the
schedule/operator table. I am assuming that your recordset is similiar to
the example below.

OperatorID Date Day/Schedule
------------ -------- ----------------
Op_01 7/11/05 Monday: Start 9:00 to 13:00


Here's a sql statement that calculates last week's schedules on Monday,
calculates the new schedule date for each operator and then inserts them into
the tblOperator.

INSERT INTO tblOperator ( OperatorID, Schedule, [Date] )
SELECT tblOperator.OperatorID, tblOperator.Schedule, [date]+7 AS NewDate
FROM tblOperator
WHERE (((tblOperator.Date)>=Now()-7));
 
M

Mark Pilbeam

Sorry for my ignorance, but where would I put the SQL statement, and what
sort of control would it be?
Also, Would this statement create all new records?
For example:
Operator_1 will have at least five records for each week (Monday - Friday)
What I would like to do is have a control on the form which will allow the
execution of a script which will create new records for Operator_1 i.e. 5
new records, Monday to Friday.

Many thanks

MarkT52553 said:
Mark,

I would do this with a query to locate the schedules of all operators for
the previous week, then append the new recordset back to the
schedule/operator table. I am assuming that your recordset is similiar to
the example below.

OperatorID Date Day/Schedule
------------ -------- ----------------
Op_01 7/11/05 Monday: Start 9:00 to 13:00


Here's a sql statement that calculates last week's schedules on Monday,
calculates the new schedule date for each operator and then inserts them
into
the tblOperator.

INSERT INTO tblOperator ( OperatorID, Schedule, [Date] )
SELECT tblOperator.OperatorID, tblOperator.Schedule, [date]+7 AS NewDate
FROM tblOperator
WHERE (((tblOperator.Date)>=Now()-7));

Mark Pilbeam said:
I have a form, attached to a table which stores records for an Operators
work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record, in a
form, and have all of the records of the Operator duplicated as new
records?
This would mean that at the beginning of each week I could easily
reproduce
the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

Grateful,

Mark
 
G

Guest

Mark,

You could use a command button on the form and set the on click event to run
the query that I have described in my original note. In my original example
I am using the records/schedules for the previous week to create the new
schedules and append them back to the same table. Hope this makes sense. If
you want I'll send you an example db so you can see it in action. I'll need
you email.

Mark

Mark Pilbeam said:
Sorry for my ignorance, but where would I put the SQL statement, and what
sort of control would it be?
Also, Would this statement create all new records?
For example:
Operator_1 will have at least five records for each week (Monday - Friday)
What I would like to do is have a control on the form which will allow the
execution of a script which will create new records for Operator_1 i.e. 5
new records, Monday to Friday.

Many thanks

MarkT52553 said:
Mark,

I would do this with a query to locate the schedules of all operators for
the previous week, then append the new recordset back to the
schedule/operator table. I am assuming that your recordset is similiar to
the example below.

OperatorID Date Day/Schedule
------------ -------- ----------------
Op_01 7/11/05 Monday: Start 9:00 to 13:00


Here's a sql statement that calculates last week's schedules on Monday,
calculates the new schedule date for each operator and then inserts them
into
the tblOperator.

INSERT INTO tblOperator ( OperatorID, Schedule, [Date] )
SELECT tblOperator.OperatorID, tblOperator.Schedule, [date]+7 AS NewDate
FROM tblOperator
WHERE (((tblOperator.Date)>=Now()-7));

Mark Pilbeam said:
I have a form, attached to a table which stores records for an Operators
work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record, in a
form, and have all of the records of the Operator duplicated as new
records?
This would mean that at the beginning of each week I could easily
reproduce
the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

Grateful,

Mark
 
M

Mark Pilbeam

Hi Mark,

Would be grateful for hat.

(e-mail address removed)

Mark

MarkT52553 said:
Mark,

You could use a command button on the form and set the on click event to
run
the query that I have described in my original note. In my original
example
I am using the records/schedules for the previous week to create the new
schedules and append them back to the same table. Hope this makes sense.
If
you want I'll send you an example db so you can see it in action. I'll
need
you email.

Mark

Mark Pilbeam said:
Sorry for my ignorance, but where would I put the SQL statement, and what
sort of control would it be?
Also, Would this statement create all new records?
For example:
Operator_1 will have at least five records for each week (Monday -
Friday)
What I would like to do is have a control on the form which will allow
the
execution of a script which will create new records for Operator_1 i.e. 5
new records, Monday to Friday.

Many thanks

MarkT52553 said:
Mark,

I would do this with a query to locate the schedules of all operators
for
the previous week, then append the new recordset back to the
schedule/operator table. I am assuming that your recordset is similiar
to
the example below.

OperatorID Date Day/Schedule
------------ -------- ----------------
Op_01 7/11/05 Monday: Start 9:00 to 13:00


Here's a sql statement that calculates last week's schedules on Monday,
calculates the new schedule date for each operator and then inserts
them
into
the tblOperator.

INSERT INTO tblOperator ( OperatorID, Schedule, [Date] )
SELECT tblOperator.OperatorID, tblOperator.Schedule, [date]+7 AS
NewDate
FROM tblOperator
WHERE (((tblOperator.Date)>=Now()-7));

:

I have a form, attached to a table which stores records for an
Operators
work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record,
in a
form, and have all of the records of the Operator duplicated as new
records?
This would mean that at the beginning of each week I could easily
reproduce
the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

Grateful,

Mark
 
G

Guest

Mark,

I emailed an example database to the address you provided.

Mark

Mark Pilbeam said:
Hi Mark,

Would be grateful for hat.

(e-mail address removed)

Mark

MarkT52553 said:
Mark,

You could use a command button on the form and set the on click event to
run
the query that I have described in my original note. In my original
example
I am using the records/schedules for the previous week to create the new
schedules and append them back to the same table. Hope this makes sense.
If
you want I'll send you an example db so you can see it in action. I'll
need
you email.

Mark

Mark Pilbeam said:
Sorry for my ignorance, but where would I put the SQL statement, and what
sort of control would it be?
Also, Would this statement create all new records?
For example:
Operator_1 will have at least five records for each week (Monday -
Friday)
What I would like to do is have a control on the form which will allow
the
execution of a script which will create new records for Operator_1 i.e. 5
new records, Monday to Friday.

Many thanks

Mark,

I would do this with a query to locate the schedules of all operators
for
the previous week, then append the new recordset back to the
schedule/operator table. I am assuming that your recordset is similiar
to
the example below.

OperatorID Date Day/Schedule
------------ -------- ----------------
Op_01 7/11/05 Monday: Start 9:00 to 13:00


Here's a sql statement that calculates last week's schedules on Monday,
calculates the new schedule date for each operator and then inserts
them
into
the tblOperator.

INSERT INTO tblOperator ( OperatorID, Schedule, [Date] )
SELECT tblOperator.OperatorID, tblOperator.Schedule, [date]+7 AS
NewDate
FROM tblOperator
WHERE (((tblOperator.Date)>=Now()-7));

:

I have a form, attached to a table which stores records for an
Operators
work timetable.
The Operator works Monday to Friday, with each day of the working week
consisting of a number of hourly periods. Each day is a record of the
Operators working hours.
For Example,
Operator: Paul Smith
Record 1- Monday: Start 9:00 to 13:00
Record 2 - Tuesday: Start 10:30 to 17:00

I would like to be able to enter an Operator code into a new record,
in a
form, and have all of the records of the Operator duplicated as new
records?
This would mean that at the beginning of each week I could easily
reproduce
the working schedule for each of my Operators.

Is there any way this can be done using a control and code?

Grateful,

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top