Results 1 to 3 of 3

Thread: Same ADO control on 2 forms

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 1999
    Location
    Duluth
    Posts
    16

    Post

    Hello,

    I was just wondering if it is possible to access ADO control from one form to a different form. My form became to cluttered and I even added tabs so I simply made a second form. However i cannot access the the control from the original form and it is an updating headache. Is it possible to set the properties to show the control from a different form. Thanks a lot

    Ronny

  2. #2
    New Member
    Join Date
    Aug 1999
    Posts
    3

    Post

    If you want to access controls that are on a different form, you have to preceed it with the form name:

    For Example:
    To access the ADO data control on Form2 from Form1 you would use the following line in Form1:
    Form2.ADODBControl.Recordset.Open [tablename]

  3. #3
    New Member
    Join Date
    Aug 1999
    Location
    Foxboro
    Posts
    4

    Post

    You may also open the other form and pass a recordset to the other form in one of the methods.
    Form1 call form2
    Method in form2
    ....search(rs as recordset)
    end sub
    Then you maay do
    dim f as form2
    set f = new form2
    f.search recordset

    Also you may use a global connection by declaring it as a global, open it and then use it in several forms.
    opening different recordsets.

    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width