Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 31st, 2004, 11:36 PM
Registered User
Join Date: Jul 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default DLookup - URGENT

I am having trouble trying to get my head around the dlookup function and was hoping someone could explain it to me in laymans terms. I understand the basics, but what I am trying to do is display a field based on TWO variables matching.
Details are :
Usage Info form (tariff type, usage)
savings table (tariff type, start usage, end usage, savings) - where start usage and end usage are numberic fields and the usage from the usage info table will be between these two figures.
I want to display the savings field from the savings table on the usage info form.
Can anyone help me out, this needs to be finshed in the next few hours. Thanks in advance!

Old September 2nd, 2004, 06:51 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

How about...

Me.Savings = DLookUp("[savings]", "Savings Table", _
"[start usage] <= " & Me.Usage & " And [end usage] >= " & Me.Usage)

Where Me.Savings and Me.Usage are the textboxes in the form.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Old September 5th, 2004, 08:33 PM
Registered User
Join Date: Jul 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks Greg, I'll give this a shot.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Dlookup JAdkins Access VBA 1 January 11th, 2008 06:52 PM
Help with DLookup Devilboy13 Access VBA 4 August 30th, 2006 02:48 PM
DLookup Urgent ahying Access VBA 3 August 18th, 2006 11:29 PM
DLookup Teqlump Access VBA 1 August 9th, 2006 11:48 PM
How to Update DLOOKUP? cesather Access 1 December 14th, 2005 05:39 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.