A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using the second column of a lookup field in row source



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2010, 04:02 PM posted to microsoft.public.access.forms
Lawrence Chu
external usenet poster
 
Posts: 4
Default Using the second column of a lookup field in row source

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?
  #2  
Old June 1st, 2010, 04:13 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Using the second column of a lookup field in row source

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" wrote in message
...
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?



  #3  
Old June 1st, 2010, 04:34 PM posted to microsoft.public.access.forms
Lawrence Chu
external usenet poster
 
Posts: 4
Default Using the second column of a lookup field in row source

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"
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!)

  #4  
Old June 1st, 2010, 04:37 PM posted to microsoft.public.access.forms
Lawrence Chu
external usenet poster
 
Posts: 4
Default Using the second column of a lookup field in row source

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"
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" wrote in message

...

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?


  #5  
Old June 1st, 2010, 06:53 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Using the second column of a lookup field in row source

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" wrote in message
...
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"
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!)



  #6  
Old June 2nd, 2010, 07:45 AM posted to microsoft.public.access.forms
Lawrence Chu
external usenet poster
 
Posts: 4
Default Using the second column of a lookup field in row source

All right, I'll see if I can manage that.

Thanks!

On Jun 1, 7:53*pm, "Douglas J. Steele"
wrote:

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.