GPGeorge
George Hepworth
- Local time
- Today, 12:04
- Joined
- Nov 25, 2004
- Messages
- 2,954
Interestingly enough, I've been so conditioned not to use BETWEEN because of the problem of Dates with times. It is appropriate here and is simpler syntax.Or ... SLIGHTLY less typing
Code:Me.Assigned_To = DLookup("Analyst", "[tbl_company_analysts]", "'" & companyF & "' BETWEEN [StartRange] AND [EndRange]" )
With the understanding that this ONLY works correctly when the text ranges are all exactly the same length in text characters as well as being all uppercase; and companyF has to ALSO be uppercased as well as extracted: UCASE( LEFT( company-name, 3 )) - if you are using 3-character ranges.