Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bound columns, column counts, col widths and list widths

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
i created a combo box having five columns and seven rows. the first one is a number column (1,2,....7) which i set an index key in order to have the text information sorted per the row value of this column. the remaining columns are text and of differing lengths which are approximately, 1", .25", 2" and 6".

in deploying this combo box, i tell access 2000 my display control is a combo-box, that the row source type is a table/query, the name of the row soure's, that i want the bound column to be 3, that there are 5 columns, not to use the column heads, that the column widths are 0",1",.25",2" and 6" respectively for columns 1 through 5 because i don't want column number 1's information displayed. i tell access to list the default 8 rows, that the list width is 9.25" and to limit the entry to the list.

problem is that when i click on the drop down button to test this what i see does not make good sense --- i.e. the left most column displayed has the data from the 3rd column in the combo box and is displayed with about as much width as should be given to the 2nd column and the second column displayed in the drop down combo box the user will see holds the data from the 3rd column. in other words, access (correctly) omitted the display of the first column and juxtaposed the display of columns 2 and 3.

the problem is corrected when i juxtapose the widths and enter the widths thus: 0",0.25",1";2";6";

i'm scratching my head but happy i managed to 'figure it out' --- whatever this means?
 
Hi,

Did you know that by default, the first column in a combo/listbox is 0? e.g. column(0).

On the other hand, the property Data->Bound Column refers to a column's ACTUAL position (i.e. first column IS column 1).

If you want to refer to an 'index' naturally (i.e. column(1) instead of column(0), then add 'Option Base 1' to the top of a module.
This will also affect VB arrays - you then refer to the first array column as 1 - not zero.

I don't know if this is causing your problem, but it sounds likely.

Regards,

Darrylle
"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
well, now that's interesting, all this talk about the first being the 0th column and and all that, but there is one small 'catch' to the theory (though i wish there weren't) and that is that there's no vba coding going into this (unless access is doing something on its own). i was referring to the number of columns and the order of the one i want bound to the control w/o resorting to vba.

thanks in advance (or anyway as the case might be).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top