I came in late on this dialogue between you two. Slick idea, Larry!!
David Blocker [EMAIL PROTECTED] 781-784-1919 Fax: 781-784-1860 Cell: 339-206-0261 ----- Original Message ----- From: "Lawrence Lustig" <[EMAIL PROTECTED]> To: "RBG7-L Mailing List" <[email protected]> Sent: Sunday, February 06, 2005 11:17 AM Subject: [RBG7-L] - Re: Recycling Data > > I am working on the ENTRY form at this time, so both the header and detail > > and other data is being entered, not edited. The detail table is temporary > > and gets appended to the permanent detail table. > > OK, here's what I would do. I'm confining this to a form with two tables. In > general, I prefer to use a variable lookup listbox to display my second table > and then go to another form to edit the row if necessary, but this should work > with either a lookup listbox, a scrolling region, or a grid for the detail > table. > > The basic idea is that you start with a header record and no detail lines. You > include a <<New Segment>> button on the form, which will contain (or call) the > code to add a new segment. This button will > > 1. Check the current "last destination" and compare it with the final > destination in the header record. > 2. If they are the same say "route is complete" and exit. (Additionally, you > can check this at form startup and after each segment is added and disable the > <<New Segment>> button when it is no longer appropriate). > 3. Save the data in the current table. > 4. Ask the user, through a menu or other method, for the destination for the > new segment. > 5. Perform any default lookups and calculations necessary to populate the new > detail row. > 6. Issue an INSERT command to put the new detail row into the table. > 7. Use PROPERTY TABLE DetailTable REFRESH (in the case of a scrolling region or > grid) or PROPERTY ListBoxName REFRESHLIST TRUE (in the case of a variable > lookup listbox) to refresh the display and show the new record. > 8. Perform any other updates to the screen (such as RECALC VARIABLES) to show > the current status of the record. > > This does not handle the issue of inserting segments into the middle of the > route, which involves much the same logic but also updating the immediately > preceding and following rows in the detail table as well. > -- > Larry >
