From: Lawrence Chu on
I'm working on a form on a database in which I need to do a lookup on
one combo box that contains two columns, and a followup combo box
requires that I match something in the second column. So, basically,
if I have Box A, which looks up a BoxA_ID column (column 1) and a
BoxA_Value (column 2) column, I'd like to create a statement in Box B
where I'm trying to match a value with the BoxA_Value column.

Can anyone help me here?
From: Douglas J. Steele on
Not really sure what it is you're trying to do.

To refer to the value in the first column of the currently selected row of
list box BoxA, you refer to Me!BoxA.Column(0) (or
Forms!NameOfForm!BoxA.Column(0))

To refer to the value in the second column of the currently selected row of
list box BoxA, you refer to Me!BoxA.Column(1) (or
Forms!NameOfForm!BoxA.Column(1))

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"Lawrence Chu" <lawrencechu(a)gmail.com> wrote in message
news:46f5ffd7-4671-4f9a-80c1-7705c12ff55f(a)o39g2000vbd.googlegroups.com...
> I'm working on a form on a database in which I need to do a lookup on
> one combo box that contains two columns, and a followup combo box
> requires that I match something in the second column. So, basically,
> if I have Box A, which looks up a BoxA_ID column (column 1) and a
> BoxA_Value (column 2) column, I'd like to create a statement in Box B
> where I'm trying to match a value with the BoxA_Value column.
>
> Can anyone help me here?


From: Lawrence Chu on
That sounds like exactly what I want! For some reason it doesn't seem
to be working, but it may simply be another part of the SQL statement
I'm working on.

Unless that doesn't work in SQL. >_>

On Jun 1, 5:13 pm, "Douglas J. Steele"
<NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote:
> Not really sure what it is you're trying to do.
>
> To refer to the value in the first column of the currently selected row of
> list box BoxA, you refer to Me!BoxA.Column(0) (or
> Forms!NameOfForm!BoxA.Column(0))
>
> To refer to the value in the second column of the currently selected row of
> list box BoxA, you refer to Me!BoxA.Column(1) (or
> Forms!NameOfForm!BoxA.Column(1))
>
> --
> Doug Steele, Microsoft Access MVPhttp://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)
From: Lawrence Chu on
That sounds like exactly what I need! I'm still having problems with
the form on my end, but that's probably part of the statement I'm
working on.

Unless .Column(X) doesn't work in SQL?

I'd give you the details on what I'm doing but I'd end up rambling on
different tangents, like that time I went to Shelbyville. I wore an
onion on my belt as was the fashion of the time...

On Jun 1, 5:13 pm, "Douglas J. Steele"
<NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote:
> Not really sure what it is you're trying to do.
>
> To refer to the value in the first column of the currently selected row of
> list box BoxA, you refer to Me!BoxA.Column(0) (or
> Forms!NameOfForm!BoxA.Column(0))
>
> To refer to the value in the second column of the currently selected row of
> list box BoxA, you refer to Me!BoxA.Column(1) (or
> Forms!NameOfForm!BoxA.Column(1))
>
> --
> Doug Steele, Microsoft Access MVPhttp://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)
>
> "Lawrence Chu" <lawrence...(a)gmail.com> wrote in message
>
> news:46f5ffd7-4671-4f9a-80c1-7705c12ff55f(a)o39g2000vbd.googlegroups.com...
>
> > I'm working on a form on a database in which I need to do a lookup on
> > one combo box that contains two columns, and a followup combo box
> > requires that I match something in the second column.  So, basically,
> > if I have Box A, which looks up a BoxA_ID column (column 1) and a
> > BoxA_Value (column 2) column, I'd like to create a statement in Box B
> > where I'm trying to match a value with the BoxA_Value column.
>
> > Can anyone help me here?

From: Douglas J. Steele on
No, I don't believe you can refer to the Column collection in a SQL
statement.

One approach would be to create a function that returns the value.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"Lawrence Chu" <lawrencechu(a)gmail.com> wrote in message
news:6e58374a-0261-4ec7-bdf1-71abefdb2fd4(a)k31g2000vbu.googlegroups.com...
That sounds like exactly what I want! For some reason it doesn't seem
to be working, but it may simply be another part of the SQL statement
I'm working on.

Unless that doesn't work in SQL. >_>

On Jun 1, 5:13 pm, "Douglas J. Steele"
<NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote:
> Not really sure what it is you're trying to do.
>
> To refer to the value in the first column of the currently selected row of
> list box BoxA, you refer to Me!BoxA.Column(0) (or
> Forms!NameOfForm!BoxA.Column(0))
>
> To refer to the value in the second column of the currently selected row
> of
> list box BoxA, you refer to Me!BoxA.Column(1) (or
> Forms!NameOfForm!BoxA.Column(1))
>
> --
> Doug Steele, Microsoft Access MVPhttp://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)