combobox problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • indhu
    New Member
    • Oct 2006
    • 140

    #1

    combobox problem

    hi all

    tablename-sequence
    formname sequence
    fieldname (sequence)

    How to retrieve the value from sequence table to form 5 where i ve combobox (sequence). i want the vlue to come to this combo.
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by indhu
    hi all

    tablename-sequence
    formname sequence
    fieldname (sequence)

    How to retrieve the value from sequence table to form 5 where i ve combobox (sequence). i want the vlue to come to this combo.

    Dim i As Integer
    Dim strSql As String
    Dim rs1 As ADODB.Recordset
    Dim strSql as string
    Set rs1 = New ADODB.Recordset
    strSql = ""
    strSql = "select fldSequence, fldSequenceId from tblSequence"
    rs1.Open strSql, Conn, adOpenKeyset, adLockOptimisti c
    For i = 1 To rs1.RecordCount
    cmbSequence.Add Item Trim(rs1.Fields ("fldSequence") )
    cmbSequence.Ite mData(cmbSequen ce.NewIndex)=rs t1.Fields("fldS equenceId")
    rs1.MoveNext
    Next i

    Use this Code

    Comment

    • indhu
      New Member
      • Oct 2006
      • 140

      #3
      Originally posted by hariharanmca
      Dim i As Integer
      Dim strSql As String
      Dim rs1 As ADODB.Recordset
      Dim strSql as string
      Set rs1 = New ADODB.Recordset
      strSql = ""
      strSql = "select fldSequence, fldSequenceId from tblSequence"
      rs1.Open strSql, Conn, adOpenKeyset, adLockOptimisti c
      For i = 1 To rs1.RecordCount
      cmbSequence.Add Item Trim(rs1.Fields ("fldSequence") )
      cmbSequence.Ite mData(cmbSequen ce.NewIndex)=rs t1.Fields("fldS equenceId")
      rs1.MoveNext
      Next i

      Use this Code

      No hari, its not working

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by indhu
        No hari, its not working
        Where and how you are useing that combo box

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by hariharanmca
          Where and how you are useing that combo box
          Yes, we definitely need more detail. Is this standalone Visual Basic? If so, what version? Is it a VBA module in Access? Perhaps you are simply working on a Form in Access, with no VB involved?

          Plus, more detailed info about the tables/fields involved would be useful. Try to describe the situation in as much detail as you can manage.

          Comment

          Working...