Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to limit Dlookups in the code 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
Below is the code I am using to fill in a field on my form.
I have many Method types to lookup "001" is the example
below. I also have "002", "003", etc. etc. My question is
Is there away to look up the different method types in
one Dlookup and populate the (Me.Method10) field with the
proper field from the Table or do I have to put in this
code for every different method type?


Code:
If DLookup("[Pull_Seque]", "MainEntryQrySelect") = "001" Then
Me.Method10 = DLookup("[Method]", "ReplenishMethodTbl", "[PullSeqCode] = '" & "001" & "'")
End If
 
Something like this ?
Code:
Me.Method10 = DLookup("[Method]", "ReplenishMethodTbl", "[PullSeqCode] = '" & DLookup("[Pull_Seque]", "MainEntryQrySelect") & "'")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Great PHV!!

If you get the chance can you explain how that works?
 
Also investigave subqueries.

Makes the tables non updateable, but an order of magnitude faster on large data sets.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top