When my listbox displays all my records it misses out displaying the Username (1th Column) and my first record.
Could anyone explain this :confused:
Printable View
When my listbox displays all my records it misses out displaying the Username (1th Column) and my first record.
Could anyone explain this :confused:
- what programming language do you use?
- what database (if any) do you use?
- what type of listbox do you use?
- how do you populate your listbox?
Few other questions may popup as well but as you can see you have to be much more specific when searching for a help.
- VBA with Access
- Access
- The only one you can use
- listbox.addItem()
Sorry, I wrote that in a rush
Missing column is on columnwidths property - if you have 0;1cm... you hide the first column (handy to hidde the ID)
Can't see why you'd be missing the first (1st) row and column unless you are looping from 1 instead of 0 to populate the rows and columns.
Can you post your code to populate the list box?
There is no 'code' needed. When I created the listBox it was 'linked' to my table. However in the property DataSource (in the listbox) was an SQL query. Like this:
DataSource..........: SELECT * FROM Users
Note that the above is not the exact value I entered. I only wrote it so you could understand what I meant.
I will post the Database as soon as I have access to it (In about two days)
Quote:
Originally Posted by singularis
I'm a little confused - first you said "AddItem" and now "it's linked"...Quote:
Originally Posted by singularis
Which one is true? :confused:
And that could make a huge difference if you specify list of fields in your query.Quote:
Originally Posted by singularis
When you put a listbox on a form a wizard should step you through the process linking it to a table. This is what I understand you to mean when you say
There is no 'code' needed. When I created the listBox it was 'linked' to my table.
The wizard will also give you the option of hiding the key column.
There is no datasource property associated with a listbox. Your statement...
DataSource..........: SELECT * FROM Users
doesn't make sense to me.
You should have a Data Source Type which defaults to Table/Query and you should have Row Source which defaults to the fields you picked in your table. It should look something like Select yourTable.Field1, yourTable.Field2, yourTable.Field3;
Your listbox should display all the rows in your table and all the fields you have chosen. The only possibilty I can think of is that you have NULL values in your first row.
@LinXG & RhinoBull: Sorry for being confusing, but I did not have the information in front of me and guessed the values and properties so that you get a gist of what I am talking about.
Thanks for helping me, I will reply if it works....