Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best approach to code form class?
Message
De
08/02/2002 11:31:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Best approach to code form class?
Divers
Thread ID:
00617445
Message ID:
00617445
Vues:
70
I have a FORM CLASS with FIELD CONTROLS to reflect values in tables 'myTable1' & 'myTable2' + COMMAND BUTTON CONTROLS: next, back, new, change, find. I'm currently using VFP tables, but will eventually convert to SQL.

To populate the field controls, I have an SQL SELECT statement in my form class' LOAD event: SELECT * FROM myTable1 LEFT JOIN myTable2 ON myTable1.id=myTable2.ID into cursor xTable. I then would like to free up myTable1 & myTable2 (close them) so that if at any time I need to do a MODIFY STRUCTURE on myTable1 or myTable2, I can open the tables EXCLUSIVEly. I have set the field controls' CONTROL SOURCE property to xTable.fieldname (where xmyTable = cursor created), as opposed to myTable1.fieldname & myTable2.fieldname (myTable1 & myTable2 should now be closed). So far, is that OK?

I'd like to avoid using 'USE myTable1', 'SET RELATION' etc. since I would be converting to SQL tables & those commands does not work with SQL tables (??). What is the preferred way to code the form class? I'd like to bring up the form with the first record in myTable1, and user then can then click on the NEXT or BACK command button to navigate through myTable1. If user click on the NEW button, the form takes in their data entry & upon clicking a SUBMIT button, updates data entered into myTable1. Do I set all field controls' CONTROL SOURCE to xmyTable.fieldname? This seems to work great if user just want to navigate through the table by clicking the NEXT & BACK command buttons. But what is the table is changed/updated by somebody else: user cannot see the changes?

Is it not possible to use xmyTable.fieldname (cursor) to be able to see the changes in myTable? Must I use myTable.fieldname (table) instead?

When user click on CHANGE or NEW button: what happens then? How do I make it so that user can update the current record? Is this not possible with using the cursor?

Can anybody give me a clue what do I need to do?
Thank you all!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform