Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a record to a Table
Message
 
 
À
25/10/1998 06:51:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00147776
Message ID:
00150332
Vues:
38
John,

>Do you create the p-view in the form using CREATE SQL VIEW or do you use the View Designer and choose View Parameters from the Query menu? Or is there another way to do this? I seem to have a bit of brain lapse here...

The edit p-views I usually build in the view designer. Because they are simple every field, set an order and the filter of childtable.fk = ?parenttable.pk and check the send sql updates.

The readonly p-views I generally do in a .prg because in most cases the child table has one or more lookups into the codes table. So I hand code those just to get good names on the tables and fields:
create sql view windowsview as;
SELECT windows.iID, cWindowLetter,;
  nQuantity, nWidth, nHeight,;
  nCostPerSqFt, nPrice, lNameplate,;
  lProtectiveCovering, lLightbox, lFrames,;
  lFinalMeasurement, ;
  CodesStyle.cValue as cWindowStyle, ;
  CodesTop.cValue as cWindowTop ;
  FROM  windows ;
  INNER JOIN codes as CodesStyle;
     ON  windows.iStyle = CodesStyle.iID;
  INNER JOIN codes as CodesTop;
     ON  windows.iTopShape = CodesTop.iID ;
 WHERE windows.iProject = ?Projects.iID ;
 order by cWindowLetter
>I have a parent table EquipMfg and a child table EquipLst. I want to select a manufacturer from a combo box and display all the assets from that manufacturer that are in the EquipLst in the grid. Do I add the parent table to the DE along with a p-view of the child?

You could do that. I'd say it depends on the number of manufacturers. If it was a small enough list I'd just use a cbo that did a SELECT to an array getting manufacturer name and PK, display the name, BoundTo the cbo to the second column and then in the Valid requery the p-view and thisform.Refresh()
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform