DLookup t return a value starting with specific letter

JPed

Registered User.
Local time
Today, 16:34
Joined
Feb 11, 2014
Messages
29
Hi,

I am trying to use a DLookup to search to find what block goes into the production of an item.

In a table called "dbo_vw_MCE_job_with_materials", each item contains a list of the parts which go into its production in a column titled "Expr1". However there are always more than one parts to this, with varying names. What I am trying to do is to use a Dlookup to only return the first value which starts with B (as the block number is always the only part on the list which begins with B).

At the moment my DLookup would look ike this:

Code:
MixTypeTxt = DLookup("Expr1", "dbo_vw_MCE_job_with_materials", "[item] ='" & Forms![Theta Input]![ItemNumbertxt] & "'")

However I think as the item column contains the same item number in 8 columns, with different values in the Expr1 column, Dlookup only returns the top value "A-CF0057" (which is irrelevant as far as I am concered) - whereas I am hoping it will be able to pull the "B1499" value from the column as it is the only one starting with a B

Is there anyway to specify which value the dlookup function would return, or is there any way to apply some sort of permanent filter on my table? Not sure if this is possible but any ideas would be great.
 
Post some sample data from your data sources, include data source name and field names. Then based on that sample data, post more data which illustrates what should be returned. Use this format for posting data:

TableNameHere
Field1Name, Field2Name, Field3Name...
David, 12, 2/6/1980
Sally, 49, 10/13/2008
Larry, 1, 8/18/2009
 

Users who are viewing this thread

Back
Top Bottom