problem with retrieving all fields of the table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NasirMunir
    New Member
    • Jun 2007
    • 27

    problem with retrieving all fields of the table

    I just copied a table to access from excel. I named that as "Contents".
    I am trying to create a look-up field on a form which can return the tuples in a list box. My code is:

    Code:
    Option Compare Database
    
    Private Sub List3_BeforeUpdate(Cancel As Integer)
       
    End Sub
    
    Private Sub Text0_BeforeUpdate(Cancel As Integer)
        Dim holdVal As String
        holdVal = Me.Text0.Value
        Me.List3.RowSourceType = "Table/Query"
        Me.List3.RowSource = "SELECT * FROM Contents" & _
                                " WHERE Field4 LIKE '" & holdVal & "*'"
        Me.List3.Requery
        
    
    End Sub
    The problem is I am getting only one column in the list box. It searches well, but is not returning all the fields of the table. Can anyone help?
    Thanks
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Is the column count of your listbox set to 1?

    Comment

    • NasirMunir
      New Member
      • Jun 2007
      • 27

      #3
      YES :),
      Thanks a lot, case solved.

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        You're welcome.
        Jking

        Comment

        Working...