CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    11

    databound combo boxes

    Hi,
    I'm writing a program in Visual Basic 6. I have combo boxes that are bound to a database. I would like them to have the style property 2-Dropdown List so that a user could not change the contents of the box. It works for the ones that are not linked to the database, but when I run the program and there is nothing in the combo boxes that are linked, I get the error message "Text property is read-only" and a selection is automatically made by the program so that the box is not empty. The read-only property of the datacontrol is set to false. I was wondering if there is a way of ensuring that I don't get this message, either in Access or by writing some code in VB. If this is not entirely clear, let me know.
    Thanks in advance!
    Nicole


  2. #2
    Join Date
    May 1999
    Posts
    12

    Re: databound combo boxes

    I don´t understand ... I have this kind of combos
    and think they work properly.
    Do you establish the propierties RowSource, ListField (And RowMember if you work with ADO)
    for the items you want to show, and BoundColumn for the field you want to store in the combo when selecting?
    And the propierties DataSource (Datamember), DataField for the origin table?

    Let me know how you exactly link your combo...


    Bye!!





  3. #3
    Join Date
    May 1999
    Posts
    11

    Re: databound combo boxes

    Sorry, I should have specified that I am using DAO combo boxes. The recordset type is set to 1-Dynaset. That seems to be the only property that seems important. But let me know if you need to know more. Thank you in advance!


  4. #4
    Join Date
    May 1999
    Posts
    12

    Re: databound combo boxes

    I suppose you use a DBCombo bound to a DataControl
    or Remote Data Control.
    Dynaset recordset must work fine.
    If you are using an usual Combo box , don´t do it,
    even when it lets you bind a database field, it
    doesn´t work properly.
    If you´re using a DBCombo (i think so) and your problems persist, try to use the DataCombo and a ADO DataCOntrol (you´ll find them in Components)
    and can connect to your database with a single ODBC DSN connection, as usually.
    Then try to link the combo the same as I explained in my previous mail and tell me if your
    problems persist

    Be lucky!!

    JaIme





  5. #5
    Join Date
    May 1999
    Posts
    11

    Re: databound combo boxes

    Thanks Jaime,
    I'll try that and let you know.


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

Featured