I am trying to display all the fields in a table to a list box. I am using the query designer and am binding it to the list box. <br><br>The problem is that I can get only one field to be displayed at a time.<br><br><br>Jeremy
At what point is the query being bound to the list box (what event)?<br>You may need to do a Listbox.Requery() immediately after you bind the query to the listbox.<br><br>FWIW, this is how I would achieve what you are doing.<br><br>Create an array property(If this listbox is a subclass, create the property on it, else create the property on the form). I'll assume the array is a property of the form for this example.<br><br>Set the listbox's RowSourceType property to 5-Array and the RowSource to 'Thisform.aBound'.<br><br>Populate the array with the fields from the table(your case probably calls for this in the form load event):<br>Afields(Thisform.aBound)<br><br>FYI, although Thisform.aBound() consists of 16 columns, as long as your listbox is set to 1 column, you will only get the column names. If you want to provide more detail about the fields to the user, change your listbox's columncount and columnwidths properties to allow for the extra data. <p>Jon Hawkins<br><a href=mailto: > </a><br><a href= > </a><br>Carpe Diem! - Seize the Day!
How about a much easier way:<br><br>Forget about the array and just set the list box's RowSourceType to 6 - Fields. <p>Robert Bradley<br><a href=mailto: > </a><br><a href=
DOH!!<br><br>I thought he was trying to populate the listbox with the field names, not the values.<br><br>My mistake. <p>Jon Hawkins<br><a href=mailto: > </a><br><a href= > </a><br>Carpe Diem! - Seize the Day!
No, you are right, Jon; my mistake.<br><br>I should have said: change RowSourceType to:<br><font color=red>8 - Structure</font> <p>Robert Bradley<br><a href=mailto: > </a><br><a href=
Is there only 1 column in your list's ColumnCount property? Don't forget the builders for base VFP controls. They can be helpful <p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.