J
John Bigness
I have a Lookup Table that has 2 text fields - Code and DeptName. There are
100 entries in the table like - Code = "001", DeptName = "Accounting", etc.
In the Main table there are 10 fields called Code1, Code2, ...Code10. Each
of these has a 3 digit entry like "001", "002", etc followed by its
corresponding DeptName.
What we want is to build a query from the Main table to show each CodeX and
its corresponding DeptName. Problem is you can't just link the two tables
because you have the Code field more than once in the Main table. The query
and its results might look like this:
Code1 Name1 Code2 Name2 Code3 Name3
001 Acctg 004 Maint 001 Acctg
Since there is more than one Code field in the Main table I keep getting an
ambiguous error message. I also tried a DLookup function but couldn't get it
to work.
This should be easy to do. It's very easy in Excel using a VLookup function.
100 entries in the table like - Code = "001", DeptName = "Accounting", etc.
In the Main table there are 10 fields called Code1, Code2, ...Code10. Each
of these has a 3 digit entry like "001", "002", etc followed by its
corresponding DeptName.
What we want is to build a query from the Main table to show each CodeX and
its corresponding DeptName. Problem is you can't just link the two tables
because you have the Code field more than once in the Main table. The query
and its results might look like this:
Code1 Name1 Code2 Name2 Code3 Name3
001 Acctg 004 Maint 001 Acctg
Since there is more than one Code field in the Main table I keep getting an
ambiguous error message. I also tried a DLookup function but couldn't get it
to work.
This should be easy to do. It's very easy in Excel using a VLookup function.