>Is it possible to add tables to the data environment of a screen programatically. The DE has newobject and addobject but I can't seem to get the syntax to work. If I place all the tables I want to use in the DE the form takes too long to open and if I just open the tables later they are not included in the DE and I must manually close them etc.
Normally, tables should not take much time to open. However, you can:
Thisform.DataEnvironment.AddObject("MyCursor","Cursor")
With Thisform.DataEnvironment.MyCursor
.Database="mydata.dbc"
.CursorSource="mytable"
*** etc.
Endwith
Edward Pikman
Independent Consultant