Referencing Lookup data

G

Guest

When referencing data from a combo box that is based on a lookup field, is
there a special syntax to specify the column you want the equation to refer
to? Changing around the bound column in the form field properties doesn't
seem to change anything. The value being passed through to the VBA code
seems to be the index key, however, I'm having trouble with my debugger. Can
I make the field a text field and refer to it that way? Doing so seems to
prevent me from referring to anything other than the index.
 
J

Jason Lepack

The Evils of Lookup Fields in Tables
http://www.mvps.org/access/lookupfields.htm

The field that has the combo box doesn't store the looked up value at
all. The value of that combo box is the id that corresponds to that
looked up value.

Why do you want to refer to something other than the index? If you
describe what you are trying to do then maybe we can give you a better
suggestion.

Cheers,
Jason Lepack
 
G

Guest

I

i_takeuti

Jaybird said:
Thank you. I'm sorry that I forgot to respond earlier!
--
Why are you asking me? I dont know what Im doing!

Jaybird


Arvin Meyer said:
One of the reasons to use queries instead of lookup fields:

http://www.mvps.org/access/lookupfields.htm

You can pass other columns to your code:

Me.[cboComboName].Column(3)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

will pass the fourth column (it's a zero based index)
Jaybird said:
When referencing data from a combo box that is based on a lookup field,
is
there a special syntax to specify the column you want the equation to
refer
to? Changing around the bound column in the form field properties
doesn't
seem to change anything. The value being passed through to the VBA
code
seems to be the index key, however, I'm having trouble with my
debugger.
Can
I make the field a text field and refer to it that way? Doing so seems
to
prevent me from referring to anything other than the index.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top