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!

Recycling a form for different tables

Status
Not open for further replies.

jlockley

Technical User
Nov 28, 2001
1,522
US
I would like to use the same form for various tables created for different searches via querry, whose results I set to their own folders with the querry property box.

Having created a useful form for one of them, the plan has been simply to copy it into the new folder. How do I manage to change the name of the source table in the Data Model without necessitating resetting all of the fields?

(The current method involves renaming the original source table so the form cannot find it and then choosing a new table, but I bet there's an easier way)

Gracias.
 
I've done something like this in the past. Typically the way I do it is to use a table structure that conforms to the fields in the form. I then link this empty table to the form and use a query to create the information I need in an answer table. I then add the contents of answer table into the formerly emtpy table that drives the form.

By doing it this way I can have buttons on the form that drive the queries and add the results of the answer table into the table that drives the form.
 
jlockley,

Once you set things up as beanbrain suggests, you'll want to use some code to handle the actual table assignment and reporting process. Take a peek at if you're looking for some ideas along those lines.

Hope this helps...

-- Lance
 
Thanks. I have done it that way, but found it cumbersome (the operative phrase here is lazy) - but with code it could be interesting.

Note that I set querries directly to the file I use rather than the answer table. I guess there's no way to replace one table with another identical table in the data model then.

 
jlockley,

If you want to do it manually, choose Change Table from the Open Report dialog.

To do it with ObjectPAL:

1. Declare a ReportOpenInfo variable,

2. Set the Name member to the report's filename.

3. Set the MasterTable member to the table you wish to use in the report.

4. Open the report with the ReportOpenInfo variable

For a demonstration, please see the article I linked to earlier in the thread.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top