?
Solved

how can i access to form2 componenets on form1

Posted on 2003-02-23
6
Medium Priority
?
284 Views
Last Modified: 2010-04-04
how can i access to form2 componenets on form1?
i have a paradox table .
table1 component is on form1 but i want to change the it's properties on form2!
how can i access to table1 Component?
0
Comment
Question by:shahabedeen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:shahabedeen
ID: 8005955
Thnaks!
0
 
LVL 2

Accepted Solution

by:
BorlandMan earned 120 total points
ID: 8006039

include the unit in your uses clause.

you can open form2 in the development environment and then (shortcut) click File menu and select 'Use units', it should display the form1 unit, pick it and your good to go.

Only potential problem is that if form1 is invoking form2

ex:

TForm1.DisplayForm2BtnClick (Sender: TObject);
begin
  form2.ShowModal;  // assuming you are
                    // autocreateing this form.

end;

and then in form2

your doing something like this

TForm2.FormCreate(Sender:TObject);
begin
  form1.Table1.First;
end;

if you are doing something like this, you may find yourself receiving an error from the compiler saying something about "circular references", if so, then move the 'uses form1' from the initialization section to the implementation section of form2's unit. and that should fix it.

hope that helps,
sincerely,
J
0
 
LVL 1

Expert Comment

by:TAZI
ID: 8006645
Hi ..

Include in the uses clause ... Form2.

Example:)

implementation

uses Form2

procedure TForm1.Button1Click(Sender : TObject);
begin
  Form2.Table1.First; (As shown by BorlandMan above)
end;

Hope this information is useful

Thanks
Regards
TAZI
0
 

Expert Comment

by:CleanupPing
ID: 9317105
shahabedeen:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9956144
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept BorlandMan's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question