Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending to views
Message
From
15/07/1998 15:31:59
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00116402
Message ID:
00117785
Views:
21
>>Views are not for reporting- it's cursors which should be used there. Views are for data manipulation especially to update multiple records (e.g. all childs pertained to one parent record) at a time.
>
>Well, I can't speak from experience until I've done some reports with views, but the instructor was doing some cool things with veiws for reports. Much better than scanning through a table, searching another, adding this and that...

Did your instructor tell you what is cursor? It has nothing common with scanning through a table, searching another, adding this and that...

>Maybe I'm missing something. Here's a summary:
>
>I have a clients table, a trips table, and a locations table. On the form, the clients table is the main one. The trips table is in a grid, linked to the clients table by CLIENTKEY. The locations table is linked to the trips table in two places: PICKUP and DROPOFF. In the grid, I want all the records from trips to show, but I want LOC from locations to show in place of both PICKUP and DROPOFF.

That's Ok, and I remember that I answered how to make this grid.

>I've decided to make the grid read-only, so that saves some hassle. But I want the user to be able to click on a record in the grid, click on the view button, and have another form come up.

No problems again. You can even include this button into grid row. If grid is read-only then you can even replace view with cursor.

>This new form has trips as the main table. There is no grid. Also on the form is the pickup and dropoff. But instead of the key numbers being displayed, I want several textboxes that contain the complete location information that matches the PICKUP and DROPOFF fields.

Very good. You just have some method which will populate these textboxes.value properties in a case of unbound controls. If you want to use bound controls here, then you probably will need in two 'location' aliases.

>The trip needs to be updatable. The location needs to be updatable. When the location is edited, it is to append a new record to the locations table, not change what's there. The new location key is then placed in PICKUP or DROPOFF, depending on which location was edited.

Ok

>I currently have the second form set up with trips, locations, and locations1. I have relations between them. To update the location, you need to press a button that appends a record to the locations table.
>
>The grid I haven't figured out what to do with, yet.
>
>Believe it or not, it's actually a bit more complicated since a group of trips are loaded at once, but I figured I'd better start with the simple version. :)
>
>So is this a case for views or tables?

It can be done both ways, and there are many more ones. You just should stick to one particular way which is convenient for you. My approach would be to use Client table on the first form with grid populated by cursor from trips table. Also, location columns of this gris will have customized controlsources looking for location records. The second form would have unbound textboxes populated by searching location table twice (for pick-up and drop-off).
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform