Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: What the !?!


Message #1 by "Andrew Payne" <andrewpayne.plastics@b...> on Thu, 16 May 2002 12:58:41
I have an unbound form with a combo box whose row source is a query with 6 
columns, i need to get info from the query into text boxes on the form, I 
have done this on other forms by setting the text boxes control sources to 
something like 
       =[cboSearch].column(1)
This works fine for column 1 but the other columns don't, If I put the 
code into VBA it tells me that that [cboSearch].column(2) = null even 
though there is data in all the columns. Can anyone tell me whats going on!

Thanks Andrew
Message #2 by "Amy Wyatt" <amyw@c...> on Thu, 16 May 2002 14:24:52
I am not sure why you are having the problem. It works for me. I have had 
similar 'wierd' issues with Access 2000. My suggestions is to see if it 
works for a different query on a new form with only those items on it. If 
it does, try recreating the form (it may be corrupt) or try opening it on 
another computer to see if it is your copy of Access that is doing strange 
things (don't laugh, this happens to me constantly with no rhyme or reason 
to it). Good luck.

Amy

> I have an unbound form with a combo box whose row source is a query with 
6 
c> olumns, i need to get info from the query into text boxes on the form, 
I 
h> ave done this on other forms by setting the text boxes control sources 
to 
s> omething like 
 >       =[cboSearch].column(1)
T> his works fine for column 1 but the other columns don't, If I put the 
c> ode into VBA it tells me that that [cboSearch].column(2) = null even 
t> hough there is data in all the columns. Can anyone tell me whats going 
on!

> Thanks Andrew
Message #3 by "Charlie Goodwin" <cgoodwin@c...> on Thu, 16 May 2002 10:38:59 -0400
Hi,

I'm an Access novice...so maybe this is far too simple a response, but is t
he combo's Column Count Property set to the same number of fields that your
 query outputs?

To I set up a test combo based on a test query returning lots of fields.   
Then I messed with the Cbo's column Count Property and the (xxx) of your ex
pression  " =3D[cboSearch].column(xxx)"

It seems that I can get an expression of the your type  " =3D[cboSearch].co
lumn(1)"  (which is looking at the second column of your cbo because it is 
a zero based number) to pull data from a cbo set to a Column Count of 1, bu
t if I look for, say, "=3D[cboSearch].column(2)" when the combo Column Coun
t is set to 1, then I get nothing.

If I set the Column Count Property of the combo to the same number (xxx) I 
use in your expression, then it works again.

It seems that your expression looks at the number of columns set for the co
mbo PLUS ONE MORE.   Thus it seems that the combo makes three columns of da
ta available to your expression when the Column Count Property is set to 2,
 and 4 columns of data available when set to 3 ....

But if I am understanding it right....you can't get the 5th column of data 
out of a combo set to 3 or less columns, and so on.

Hope this is useful.

Charlie











> I have an unbound form with a combo box whose row source is a query with 6
> columns, i need to get info from the query into text boxes on the form, I
> have done this on other forms by setting the text boxes control sources to
> something like
>        =3D[cboSearch].column(1)
> This works fine for column 1 but the other columns don't, If I put the
> code into VBA it tells me that that [cboSearch].column(2) =3D null even
> though there is data in all the columns. Can anyone tell me whats going o
n!
>
> Thanks Andrew


  Return to Index