Board index » delphi » Coded Mastersource does not work

Coded Mastersource does not work

Hello

(still a Delphi newby)  rewriting a CA Clipper application

The problem is that I want to switch Table1  and Table2  as Mastersources
Using the objectinspector this works fine for both tables apart but to switch
Mastersources in runtime I have to code Table1.Mastersource:=Table2.Mastersource

(and fields)  and the other way around  for the other view
I use Tabsheets and there  OnShow Event to enable the settings but nothing
happens while I can see that the procedure has been activated.
When I leave settings in the Object inspector they are not overruled by the
procedure.
What do I do wrong??

Thanks.

 

Re:Coded Mastersource does not work


If I'm understanding your need, I would suggest using a separate
TQuery or TTable for the second page. This will avoid having to switch
properties of a single query or table. Use a locate(key) to sync the
two pages if the user can navigate to a different record and you need
the other view to show the same new record.

As for your present attempt, are you refreshing the table or
re-opening the query after switching the properties? My guess is that
you must close the dataset, change the properties, reopen the dataset,
then locate the record of interest.

HTH,
Dan

On Sat, 28 Apr 2001 22:53:00 GMT, f.vd.l...@inter.nl.net (Frits v/d

Quote
Laan) wrote:
>Hello

>(still a Delphi newby)  rewriting a CA Clipper application

>The problem is that I want to switch Table1  and Table2  as Mastersources
>Using the objectinspector this works fine for both tables apart but to switch
>Mastersources in runtime I have to code Table1.Mastersource:=Table2.Mastersource

>(and fields)  and the other way around  for the other view
>I use Tabsheets and there  OnShow Event to enable the settings but nothing
>happens while I can see that the procedure has been activated.
>When I leave settings in the Object inspector they are not overruled by the
>procedure.
>What do I do wrong??

>Thanks.

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control:
visit us at www.cmdcsystems.com
[SPAM block: change at to @ in my e-mail address]

Other Threads