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!

Displaying query in tabbed form 1

Status
Not open for further replies.

LWB

Technical User
Feb 4, 2003
95
US

I've run into something I'm not sure how to get around. I have a tabbed form with the main table shown on the first tab, details on the second and several linked tables on subsequent tabs. However I would like to display on another tab a table that must be created from a query. I placed the query on the canArrive of the tab, but it will not run because the resultant table is in use (it is displayed on the tab). I can't run the query before the form is opened because it is based on the record selected in the main table (using a tilde value in the query). I did this in the past on a separate form, but I would really like to be able to show it on one of the tabs.

Does anyone have any ideas on how to do this?

Lynn
 
... However I would like to display on another tab a table that must be created from a query. .....

Save query results in a different table.
 
JoeNg,

I fail to see how saving the query results to another table will solve anything. The results need to go into some table that is displayed on the tab of the form, and the displayed table will "in use" when form is opened (even though that tab is not displayed yet). I know how to display the results on a separate form, I was just hoping to do it on the tab of the main form.

It seems like the query would have to be run when the user clicks on the tab and then the tableframe placed on the page under ObjectPal control to avoid the problem. But even if that can be done, it would seem to limit the formating options for the tableframe.

Lynn
 
Have tried running the query into a seperate table, then ADDing it to the table that is tied to the tableframe in the tabbed form?

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Mac,

Thanks, I will give that a try.

Lynn
 
Run your Query and create a table based on Answer.db. This table, e.g. Result.db, can be bound to your form in the tabbed section.
From the user form, once the Query has been run, open a TCursor on your answer and one on your result tables. This could be tcAns and tcRes. Scan tcAns and use tcRes.insertAfterRecord() to write records for viewing. Check that the answer table is not empty before moving to tab section.
When leaving tab section, or before running Query, ensure that the Result table is emptied.

 
Thanks everyone.

Based on Mac's comment, I created some new tables to put on the tabbed page, I ran the same queries as before and added the query results to the new tables (the ones displayed on the tab in the form).

I put the code in the CanArrive on the tabbed sheet - and I first empty the new tables of any old results, then run the queries, then add the query results to the new tables (I discovered I had to index them to use the Add).

This seems a little easier than CartechKoch's method (that I didn't see until after I had it working).

Thanks Mac!

Lynn
 
> I discovered I had to index them to use the Add

You should only have to change the syntax if you want to add the result table to an un-indexed one. Just set the update flag to false.


myAnsTbl.add(myTbl,True,False)



Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top