Dear All,
 
I am trying to create a multi-column combo box using the following
method:
 
1. I Added Microsoft Forms 2.0 control, there's a combo that supports
mult-icolumn. 2. I created the following procedure on Form Load:
      '*******************************************
          ' Open connection for the Cities.
            strCnn = "PROVIDER=MSDASQL;dsn=SB SQL
Server;uid=sa;pwd=;database=SBData;"
            Set cnn1 = New ADODB.Connection
                  cnn1.Open strCnn
                ' Open users table.
                  Set rstCity = New ADODB.Recordset
                        rstCity.CursorType = adOpenKeyset
                        rstCity.LockType = adLockOptimistic
                        rstCity.Open "SELECT * FROM AllCities", cnn1
                  ComboBox2.Clear
                  ComboBox2.ColumnCount = 2
                  ComboBox2.ListWidth = "6 cm" 'Total width
                  ComboBox2.ColumnWidths = "2 cm;4 cm" 'Column widths
            Do While Not rstCity.EOF
                  If IsNull(rstCity!City) Then rstCity!City = ""
                        ComboBox2.AddItem CStr(rstCity.Fields(0))
                        ComboBox2.List(0, 1) = CStr(rstCity.Fields(1))
                  rstCity.MoveNext
            Loop
      '*******************************************
The problem is in the second column I am getting the first record only
of the table, that is because I am not able to add .AddItem to the
second column as I did in the first. Any ideas how to fix this.
 
Regards,
 
Karramli
 


[Non-text portions of this message have been removed]




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to