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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saved Data Models

Status
Not open for further replies.

reinaldo

Programmer
Mar 29, 2001
31
US
I saved a data model file with 3 linked tables called Tax99.dm and I use it for my Tax form.

In PDOX10 when the form is in the design mode I select from the menu Format Data Model, I then select Data Models, when I double click on the saved DM file it removes the existing file and then loads another DM file called Tax00.dm that I want to use. I run the form and it works just fine since the tables have aliases.

Can I creat a button that will do just this?

What I am trying to do is, with the push of a button remove the Tax99.dm and load Tax00.dm data model that has already been saved.

Thanks!
 
Reinaldo,

Sort of, depending on the actual difference between your two data models. You don't replace the data model, you replace the tables in the data model.

The Format | Data Model was never fully implemented as ObjectPAL methods, however, the basics are there.

If, as I suspect, you're changing a master table, then you can open your form with a different master table using the same trick used to open reports with the results of query. In the form's case, it's:

Code:
var
   foi  formOpenInfo
   frm  form
endVar

   foi.Name = ":forms:taxes"
   foi.MasterTable = ":data:tax01"
   frm.open( foi )

On the other hand, if you're replacing a detail table, then you need dmRemoveTable() and dmAddTable(). Since you're using table aliases, you shouldn't have any problems.

Hope this helps...

-- Lance

P.S. The code is off the top of my head, you may need to tweak.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top