Hi,
I could do with a little orientation regarding a problem that I have with a combo that holds similar data.
My combo is linked to a table that contains more that 18,000 ports worldwide:
Table: [All_Ports]
[Id] = Auto number
[PortName] = Name of the Port
[CountryCode] = ISO Country Code
[PortCode] = ISO Port Code
The combo that I have shows has three columns: the Port Name, CountryCode and PortCode, but there's a problem:
We all live in a big world, and the are many ports with the same name!!
IE:
Id: 10889 - Newark GB NWK
Id: 10890 - Newark US EWR
And this is where my issue arises from, whenever I select Newark US EWR, I get the results for Newark GB NWK.
This is what I originally dad before the issue came to light:
ComboName = MyPort
CountryCode = DLookup("CountryCode", "All_Ports", "[PortName]=" & "[MyPort]" & "")
PortCode = DLookup("PortCode", "All_Ports", "[PortName]=" & "[MyPort]" & "")
MyPort = CountryCode & PortCode
Without showing the [Id] field in my Combo, what would be the best approach to get the correct data/port after selection?
By the way, I'm using Access 2007
Thanks guys,
JMC
I could do with a little orientation regarding a problem that I have with a combo that holds similar data.
My combo is linked to a table that contains more that 18,000 ports worldwide:
Table: [All_Ports]
[Id] = Auto number
[PortName] = Name of the Port
[CountryCode] = ISO Country Code
[PortCode] = ISO Port Code
The combo that I have shows has three columns: the Port Name, CountryCode and PortCode, but there's a problem:
We all live in a big world, and the are many ports with the same name!!
IE:
Id: 10889 - Newark GB NWK
Id: 10890 - Newark US EWR
And this is where my issue arises from, whenever I select Newark US EWR, I get the results for Newark GB NWK.
This is what I originally dad before the issue came to light:
ComboName = MyPort
CountryCode = DLookup("CountryCode", "All_Ports", "[PortName]=" & "[MyPort]" & "")
PortCode = DLookup("PortCode", "All_Ports", "[PortName]=" & "[MyPort]" & "")
MyPort = CountryCode & PortCode
Without showing the [Id] field in my Combo, what would be the best approach to get the correct data/port after selection?
By the way, I'm using Access 2007
Thanks guys,
JMC