Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 Form classes, same parent class, same codes, diff. tab
Message
From
22/12/2005 06:18:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01080098
Message ID:
01080117
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Hi all
>
>I have 2 form classes based on a parent class. These 2 forms contain same processing codes but uses different tables and cursor in terms on name only.
>
>Except for making the names same or macro substitution, is there any way to put the code into the base class?
>
>Please advise.

Yes, you can open two different tables with the same alias.

Let's assume for an example that you have material reception, and material delivery, in different tables. Structures are similar. Give a name to the combined table concept for instance, "MaterialMovement", or something more generic, like "TableProcessed".
* Form.Load()
use (ThisForm.cTableName) alias MaterialMovement
Later, the Grid.RecordSource, a TextBox.ControlSource, or any command, would all refer to the alias "MaterialMovement".
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform