Retrieve Look-up Field

Hdata

Registered User.
Local time
Today, 08:45
Joined
Sep 10, 2013
Messages
56
I am trying to retrieve the county name I keep in a lookup table. However, I can only get the number code for that county name and not the actual county name. I'm using the following syntax.

strCounty = Nz(.Fields("fk_CountyID"))

I use a main table with a lookup table called tblCounty with a CountyID field and a County field which identifies the name. When I use the County field name I get an error. Much thanks in advance.

Also, my access forms identify the correct county name from the fk_CountyID field I keep in my main table. No error on the forms.
 
Your story is one among many reasons why use of lookup fields in tables is not recommended. http://access.mvps.org/access/lookupfields.htm

The table contains the FK the value which is what you get. The lookup table contains the actual text commensurate with the key, which is what you get in the form. Throw out the lookup fields in your tables (change their type into TEXT FIELD). Use lookups in forms. And if needed , make queries to show the relevant data.
 

Users who are viewing this thread

Back
Top Bottom