Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data enviornment from multiple sources ?

Status
Not open for further replies.

mallee

Programmer
Nov 7, 2000
116
I have multiple sub directories of data, same files different companies. Such as \base\data1 and \base\data2
I do set path in startup and it works fine. Problem is, I
would like to be able to change from one company to another from a form, the form already has its data environment open
at the time I try to change to another. I can close all the open files and programitically opne the new ones but my form
is blank. Can I re initilize my forms data enviornment while still within the form ?
 
What do U want is a little bit complicated. I'll sugest U to put in the LOAD method of the form this code

WITH THIS

.SETALL( "DATABASE",;
gcYourDataDir+yourDataBase,;
"Cursor" )

.DATAENVIRONMENT.OPENTABLES()

ENDWITH

Also in the DATAENVIRONMENT set to .f. autoopentables and autoclosetables properties.
 
Thanks for your response. I got it figgured out. I used part of a FAQ about grids and saved the grid control source
then set recordsource to "" , did closetables, set my new path then did opentables. I allso set cursorsource path in
before open tables to mynewpath+"datafile" works great.

 
I tried to respond to this last night, but for some reason I couldn't get through to Tek-Tips for a good 20 minutes or so...then it was time to go home.

When you close a table, any controls that were bound to it lose their ControlSource and/or Recordsource properties. So, when you close all the tables and open new ones, you need to set those properties again for every control on your form.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top