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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup Between two values in a table

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB

I have a field on a form - Age.

In a table I have a list of Age ranges.

MinAge MaxAge AgeRange
10 20 10-20
21 30 21-30


What I am trying to do is whatever number is in the Age field, lookup the table and pull through the correct AgeRange depending on which numbers the age is between according to the min and max.

Any ideas

Regards
Andrew
 
=DLookUp("AgeRange","yourTble","" & [Age} & " Between MinAge And MaxAge")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Getting #Error

i now have in my source for the field:

=DLookUp("AgeRange","tblAgeRanges","" & [Age] & " Between MinAge And MaxAge")

Would it matter if MinAge & MaxAge were number datatypes?
 
What is the ControlSource of the Age control ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top