By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

problem with retrieving all fields of the table

P: 27
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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Option Compare Database
  3.  
  4. Private Sub List3_BeforeUpdate(Cancel As Integer)
  5.  
  6. End Sub
  7.  
  8. Private Sub Text0_BeforeUpdate(Cancel As Integer)
  9.     Dim holdVal As String
  10.     holdVal = Me.Text0.Value
  11.     Me.List3.RowSourceType = "Table/Query"
  12.     Me.List3.RowSource = "SELECT * FROM Contents" & _
  13.                             " WHERE Field4 LIKE '" & holdVal & "*'"
  14.     Me.List3.Requery
  15.  
  16.  
  17. End Sub
  18.  
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
Jul 19 '07 #1
Share this Question
Share on Google+
3 Replies


JKing
Expert 100+
P: 1,206
Is the column count of your listbox set to 1?
Jul 19 '07 #2

P: 27
YES :),
Thanks a lot, case solved.
Jul 19 '07 #3

JKing
Expert 100+
P: 1,206
You're welcome.
Jking
Jul 19 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.