Results 1 to 4 of 4

Thread: binding controls to Data control in other form

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Slovenia
    Posts
    43
    How can i bind a control (List or Combo) to a Data control in some other form in the same application
    Andrej Zalar

  2. #2
    Lively Member Dr_Evil's Avatar
    Join Date
    Mar 2000
    Location
    Columbus, OH
    Posts
    105
    Try this.

    For ADO
    Code:
    Set Combo1.DataSource = Form1.Adodc1
    For DAO
    Code:
    Set Combo1.DataSource = Form1.Data1
    You'll also have to set the DataField property of the control.
    Dr_Evil
    Senior Programmer
    VS6 EE
    VS.NET EA

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Slovenia
    Posts
    43
    I tried this before I asked the question for the first time, but I get the message during comiplation: Method or data member not found, which points to DataSource property of the control. Also Help tells me that DataSource is not available at runtime. Maybe it's my version of VB - 5.0 SP3?
    Andrej Zalar

  4. #4
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ....

    AndrejZ,

    Your question is correct. The DataSource property can only be assigned during design time and not in runtime. There is nothing wrong with your VB5.

    And given that, there does not seem to be a solution to your problem, because at design time, you cannot access another form's controls.

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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