>Hi Hilmar
>
>>Yes, you can open two different tables with the same alias.
>
>Thanks a lot. I was just thinking this logic is more related to making into a class, maybe a custom/line class to handle just this logic.
There is yet another way, more appropriate for a more generic custom class, for example, one that handles a standard data view/search/edit form for simple tables:
Store the table/alias name in a form property. Open the table with that alias, and use the form property in generic code, instead of hard-coding the alias. For example:
select (ThisForm.cMainAlias)
delete
if not TableUpdate()
aerror(...)
MessageBox("Can't delete record." + ...)
...
endif
In your specific instances (forms derived from the class), set the corresponding form property or properties, open the table with a specific alias, set the RecordSource for the Grid, ControlSources for TextBoxes, etc.
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)