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

Copying Records for every tuesday or every week or every month

Status
Not open for further replies.

Ouch

Programmer
Jul 17, 2001
159
GB
i have a database that books rooms and equipment

i want to be able to click a check box or something similar and repeat the booking for every day or week or month etc

i will need to duplicate the record and just change the [start Date] field to [start Date] + 1day or week etc

in the ms NORTHWIND database there is somthing that is supposed to do exactly what i want to do but it doesn't work
 
Ouch

If a user wants a booking for every day - does that create an infinite number of records?

For just a week or month you should be able to set up a loop with a append query.
EG for week:

For x = Weekday(dtDate) To 6 'think 7 is Saturday - change to suit
dtDate = DateAdd("d", 1, dtDate)
'Sql append stuff here
Next x

Might be best just to have check boxes that represent 'booked for rest of month'. But i havent thought the idea through.

Stew
 
i have tried that and it almost worked but i think my databse is to complex

i have a database that books rooms and equipment

i want to be able to click a check box or something similar and repeat the booking for every day or week or month etc
until a set date

eg.
booking is on 25/09/2001
repeat this booking every tuesday until [finish date]


the form for booking equipment has two subforms on it one holds the equipment details for the booking and the other the details of staff required

when i try the way of copying the record and pasting as a new record it give an error: some of the field names in the data you tried to past dont match the fieldnames on the form

it manages to past some of the data but no all

does anyone know of a way of copying all the data form the form (including subforms data)?

the subforms link using the BookingID from the main form
 


Hi Ouch

Getting very confused about which thread to reply to.

Try sticking to one thread at a time!

DougP suggestion (elsewhere) is very clean and I prefer it over my suggestion (although it needs a little tweaking for your purposes).

For my method - as SQL is used - i see not problem with subforms etc. And as for the finish date - you will just require a slightly different loop.

Stew



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top