Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parametizing Dataenvironment?
Message
From
12/09/1997 15:26:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Parametizing Dataenvironment?
Miscellaneous
Thread ID:
00049913
Message ID:
00049913
Views:
105
Hello all,
New to VFP - still struggling with the basics.

I have a simple table maintenance form - a code and a description. Rather than create 15 practically identical forms for the 15 tables, I want to pass the name of the table as a parameter to a single generic form 'TableMaint' and load the table at runtime. (I also pass the form's caption).

In TableMaint.init I have -
THISFORM.tablename = lcTableName && parameter passed from menu
THISFORM.grid1.recordsource=lcTableName

In DataEnvironment.init -
THIS.InitialSelectAlias = THISFORM.TableName

In DataEnvironment.OpenTables
DataEnvrionment::OpenTables
USE (THISFORM.TableName)

DataEnvironment.autoopen=.F.
DataEnvironment.autoclose=.F.

The form appears, the caption is set, but no table is loaded. It looks to me as if the DataEnvironment's init method executes before the form's so the tablename property hasn't been initialized yet.
Should I set a global variable to the table's name before running the form? But I want to be able to run multiple instances of the form.
What to do? All suggestions welcomed.

Martin
Next
Reply
Map
View

Click here to load this message in the networking platform