column(0) is where your trouble is. The ColumnCount property is a 1-based
array, not a 0-based array like some other properties. Change the (0) to (X)
where X = the bound column number.
HTH
>I am trying to select records based on the value of a combo box column. I am
>using it as criteria in a query and referring to it as follows:
[quoted text clipped - 6 lines]
>Microsoft DAO 3.6 Object library checked in References. Any suggestions
>please ?
Again, I disagree. The columns collection is zero-based. The first column
is column(0).
The problem is that you can't refer to the column by number in a query. The
query expression service doesn't handle this. Onesolution is to use a
hidden text control on the form to hold the value of column(n) and then
refer to that control.
Another solution is to write a custom function to allow you to get the value
of the column if you pass it the control and the column number
> column(0) is where your trouble is. The ColumnCount property is a 1-based
> array, not a 0-based array like some other properties. Change the (0) to
[quoted text clipped - 16 lines]
>>Microsoft DAO 3.6 Object library checked in References. Any suggestions
>>please ?
trevorbee - 01 Dec 2005 22:55 GMT
> Again, I disagree. The columns collection is zero-based. The first column
> is column(0).
[quoted text clipped - 27 lines]
> >>Microsoft DAO 3.6 Object library checked in References. Any suggestions
> >>please ?
trevorbee - 01 Dec 2005 23:01 GMT
Many thanks for your responses. I thought I had successfully used
combobox.column as criteria in a query before (long time ago) but clearly
that could not have been the case. The suggested hidden text control method
should provide the solution I need. Your help is much appreciated.
Regards
trevorbee
> Again, I disagree. The columns collection is zero-based. The first column
> is column(0).
[quoted text clipped - 27 lines]
> >>Microsoft DAO 3.6 Object library checked in References. Any suggestions
> >>please ?