Convoluted Dlookup

  • Thread starter Thread starter Stryker22150
  • Start date Start date
S

Stryker22150

I have a query where I would like to capture the 2nd character in a
text field. The second part of this would be based on that value to
return the description. I have a lookup table that contains the 2
position and the description of the value I want. I have researched the

DLookup function however I am not sure if this is the right function to

use.


TIA
 
DLookup() might work but would probably not be the best solution. If you
provided the field and table names with sample data, this question would be
much easier to answer.

Assuming you have a lookup table tblColorCodes with ColorCode and ColorName
fields with records like:
R Red
W White
G Green
O Orange
Then in your main table you have a ProductCode field where the 2nd character
is a color code value. You can add tblColorCodes to your query with your
main table. Create a new column in the query:
Field: CCode: Mid([ProductCode],2,1)
Criteria: [ColorCode]

This query might not be editable. If you need to create an editable query as
the base for a form, remove tblColorCodes and the criteria. Then add a combo
box:
Control Source: CCode
Row Source: SELECT ColorCode, ColorName FROM tblColorCodes;
Column Count: 2
Bound Column: 1
Column Widths: 0,1
 
Duane;

Thank you for the quick repsonse.

I guess I should have been more explicit in providing more detail.

Thanks.
 

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

Back
Top