Results 1 to 4 of 4

Thread: Combo Box Text [resolved]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Combo Box Text [resolved]

    I'm adding a record to a db and setting a combo boxs text to the newly added record. I haven't run into this problem before, but each time I exit the sub, the combo box text dissappears.

    VB Code:
    1. Private Sub cmbPrimaryAffiliation_Click()
    2.     Dim currentSecondary As String
    3.    
    4.     currentSecondary = cmbSecondary.text
    5.    
    6.     If cmbPrimaryAffiliation.text <> "" Then
    7.         If cmbPrimaryAffiliation.text = "Add A Company" Then
    8.             leadsAdding = True
    9.             frmAddCompany.Show vbModal
    10.             If rs.State = adStateOpen Then rs.Close
    11.             rs.Open "SELECT * FROM tblcompany ORDER BY company", cn, adOpenKeyset, adLockReadOnly, adCmdText
    12.             cmbPrimaryAffiliation.Clear
    13.             cmbSecondary.Clear
    14.             Do Until rs.EOF = True
    15.                 cmbPrimaryAffiliation.AddItem rs!company
    16.                 cmbSecondary.AddItem rs!company
    17.                 rs.MoveNext
    18.             Loop
    19.             cmbPrimaryAffiliation.AddItem "Add A Company"
    20.             cmbSecondary.AddItem "Add A Company"
    21.             cmbPrimaryAffiliation.text = frmAddCompany.compName
    22.             cmbSecondary.text = currentSecondary
    23.             leadsAdding = False
    24.         End If
    25.     End If
    26. End Sub

    The text is visible after the .Text line, but when I get to End Sub - it dissappears. Any ideas?

    Thanks
    Last edited by demotivater; Jun 30th, 2004 at 01:47 PM.

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