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

Duplicate a record reversing (or moving) 3 fields 1

Status
Not open for further replies.

TVTPeggy

Programmer
Apr 27, 2004
10
US
In a scheduling database for door to door transportation I would like to create a return trip record by duplicating all of the original trip information EXCEPT reversing the from and to destinations and moving the the return time into the pick-up time. This would be done with a command button only when there is a return trip (not always).
 
Seems to be a simple append query

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Peggy

Am I correct to assume that the "directions" involve separate "detail" records?

[tt]
DirID SortOrder Directions
1 1 North on Main 10 Km / 6 Mi
2 2 West on Forest 5 Km / 3 Mi
3 3 Bear right when Forest merges into Union
4 4 2 Block West of UltraGreen
5 5 96 Union on Right
[/tt]

If so, then the solution suggested by PHV will work, but imperfectly....

[tt]
DirID SortOrder Directions
6 1 From 96 Union on Right
7 2 2 Block East Before of UltraGreen
8 3 Bear left when Forest merges into Union
9 4 East on Forest 5 Km / 3 Mi
10 5 South on Main 10 Km / 6 Mi
[/tt]

You will have to develope a "dictionary" to translate "direction" words to point back. some are easy right / left, north / south, others going to be tough.


Richard
 
The responses both dwelled on "direction" but I never used that word and isn't relavant. Here is an example of what I mean.

Client: Joe Smith
Pickup Time: 10:00
From: 123 His House
To: 456 Doctor Lane
Return Time: 11:00

and now with a command button create another record with this info

Client: Joe Smith
Pickup Time: 11:00
From: 456 Doctor Lane
To: 123 His House
Return Time: ------

Sorry for the confusion.
 
An append query like this ?
INSERT INTO theTable (Client,[Pickup Time],From,To)
SELECT Client,[Return Time],To,From FROM theTable
WHERE [Return Time] IS NOT NULL

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PH - your suggestions led me down the right path.

TVTPeg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top