B
Barb
Hi Everyone
My database keeps track of drivers and their routes. On Calendar form I have
a folowing code in Calendar ID text box.
NewCalendarID: Nz(DMax("CalendarID","qryCalendarIDMAX"))+1
Works like a charm when I book my drivers through my calendar form.
But I'm triyng to book multiple routes at the same time.
I've build an append query that replicates calendar history and assignes new
dates, but I don'd know how to build in this NewCalendarId into it.
Here is my SQL
INSERT INTO tblCalendar ( RouteID, DriverId, VIN, Division, [Date] )
SELECT Nz(DMax("CalendarID","qryCalendarIDMAX"))+1 AS NewRouteID,
tblCalendarHistory.DriverId, tblCalendarHistory.[VIN#],
tblCalendarHistory.Division,
[date]+[Forms]![frmCalendarMultipleBooking]![txtDifferenceBetweenDates] AS
NewDate
FROM tblCalendarHistory
WHERE (((tblCalendarHistory.DriverId) Like
[Forms]![frmCalendarMultipleBooking]![cmbDriverID]) AND
((tblCalendarHistory.Division)=[Forms]![frmDivision]![txtDivision]) AND
((tblCalendarHistory.Date) Between
[Forms]![frmCalendarMultipleBooking]![txtCalendarHistoryStart Date] And
[Forms]![frmCalendarMultipleBooking]![txtCalendarHistoryEndDate]));
I get the same ID number for all my rows that I'm trying to append.
How do I increase my ID number in this query?
thank you
Barb
My database keeps track of drivers and their routes. On Calendar form I have
a folowing code in Calendar ID text box.
NewCalendarID: Nz(DMax("CalendarID","qryCalendarIDMAX"))+1
Works like a charm when I book my drivers through my calendar form.
But I'm triyng to book multiple routes at the same time.
I've build an append query that replicates calendar history and assignes new
dates, but I don'd know how to build in this NewCalendarId into it.
Here is my SQL
INSERT INTO tblCalendar ( RouteID, DriverId, VIN, Division, [Date] )
SELECT Nz(DMax("CalendarID","qryCalendarIDMAX"))+1 AS NewRouteID,
tblCalendarHistory.DriverId, tblCalendarHistory.[VIN#],
tblCalendarHistory.Division,
[date]+[Forms]![frmCalendarMultipleBooking]![txtDifferenceBetweenDates] AS
NewDate
FROM tblCalendarHistory
WHERE (((tblCalendarHistory.DriverId) Like
[Forms]![frmCalendarMultipleBooking]![cmbDriverID]) AND
((tblCalendarHistory.Division)=[Forms]![frmDivision]![txtDivision]) AND
((tblCalendarHistory.Date) Between
[Forms]![frmCalendarMultipleBooking]![txtCalendarHistoryStart Date] And
[Forms]![frmCalendarMultipleBooking]![txtCalendarHistoryEndDate]));
I get the same ID number for all my rows that I'm trying to append.
How do I increase my ID number in this query?
thank you
Barb