A
alhotch
I have a reservation application that I have obtained reservation data from
an email message (daqta from which is entered into the tblWorking table). The
email shows travel information either one-way or round trip. One way is
referenced by the literal "PRC-PHX". Round trip is referenced by the literal
"PRC-PHX-PRC". Depending on the O/W or R/T direction(s), I insert the number
one (1) for O/W or the number two (2) for R/T.
The form used by the application has a main form (Reservations table) and an
embedded subform (ReservationDetails table). The main form has info like
Name, Phone, Email, etc. The subform contains the Full Name (Last, First),
PickUP Date, Location, Time, Type, Fare, etc. The "Type" field is the one
that gets the "1" or "2" - depending on O/W or R/T.
One Way (O/W) works fine - Builds a record in the main form and a one line
record in the subform. The Reservations table has a one-to-many relationship
with the ReservationsDetail table. However, I need to append a second record
to the ReservationsDetail table (using the same AutoNumber generated
ReservationID record) when I attempt to add the other half of the round trip
travel - ie O/W makes one detail record, R/T needs to make two detail records.
Below is the current "append" query I use to make the O/W record work. How
do I add the capablity to make two records in the same query to reflect
travel "out and back" (R/T) ?
NSERT INTO qryReservationsBuild03 ( FirstName, LastName, Phone,
EmailAddress, RidersName, PickUpDate, PickUpLoc, DropOffLoc, [Time], Type,
[Note] )
SELECT tblWorking.FirstName, tblWorking.LastName, tblWorking.Phone,
tblWorking.EmailAddress, [tblWorking].[LastName] & ", " &
[tblWorking].[FirstName] AS RidersName, ([tblWorking].[SBPUMonth] & "/" &
[tblWorking].[SBPUDay] & "/" & [tblWorking].[SBPUYear]) AS PickupDate,
tblWorking.SBPULocation, tblWorking.SBDOLocation, tblWorking.SBPUTime,
IIf([tblWorking].[TripDirection]="PRC-PHX-PRC","2",IIf([tblWorking].[TripDirection]="PHX-PRC-PHX","2",IIf([tblWorking].[TripDirection]="PRC-PHX","1",IIf([tblWorking].[TripDirection]="PHX-PRC","1")))) AS FirstLeg, tblWorking.Comments
FROM tblWorking;
an email message (daqta from which is entered into the tblWorking table). The
email shows travel information either one-way or round trip. One way is
referenced by the literal "PRC-PHX". Round trip is referenced by the literal
"PRC-PHX-PRC". Depending on the O/W or R/T direction(s), I insert the number
one (1) for O/W or the number two (2) for R/T.
The form used by the application has a main form (Reservations table) and an
embedded subform (ReservationDetails table). The main form has info like
Name, Phone, Email, etc. The subform contains the Full Name (Last, First),
PickUP Date, Location, Time, Type, Fare, etc. The "Type" field is the one
that gets the "1" or "2" - depending on O/W or R/T.
One Way (O/W) works fine - Builds a record in the main form and a one line
record in the subform. The Reservations table has a one-to-many relationship
with the ReservationsDetail table. However, I need to append a second record
to the ReservationsDetail table (using the same AutoNumber generated
ReservationID record) when I attempt to add the other half of the round trip
travel - ie O/W makes one detail record, R/T needs to make two detail records.
Below is the current "append" query I use to make the O/W record work. How
do I add the capablity to make two records in the same query to reflect
travel "out and back" (R/T) ?
NSERT INTO qryReservationsBuild03 ( FirstName, LastName, Phone,
EmailAddress, RidersName, PickUpDate, PickUpLoc, DropOffLoc, [Time], Type,
[Note] )
SELECT tblWorking.FirstName, tblWorking.LastName, tblWorking.Phone,
tblWorking.EmailAddress, [tblWorking].[LastName] & ", " &
[tblWorking].[FirstName] AS RidersName, ([tblWorking].[SBPUMonth] & "/" &
[tblWorking].[SBPUDay] & "/" & [tblWorking].[SBPUYear]) AS PickupDate,
tblWorking.SBPULocation, tblWorking.SBDOLocation, tblWorking.SBPUTime,
IIf([tblWorking].[TripDirection]="PRC-PHX-PRC","2",IIf([tblWorking].[TripDirection]="PHX-PRC-PHX","2",IIf([tblWorking].[TripDirection]="PRC-PHX","1",IIf([tblWorking].[TripDirection]="PHX-PRC","1")))) AS FirstLeg, tblWorking.Comments
FROM tblWorking;