Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
DLookup multiple ID
Ester Grande 
    
4 years ago
Hi, I am having problems to figure out the correct sintax for my lookup field.

I have the following table called SottobudgetT with the following fields

IDSottobudget (primaryKey)
IDGrant (numeric)
IDAnnuality (numeric)
IDExpenseCategory (numeric)
Sottobudget (numeric)

In another form I am using the Dlookup function to get the sottobudget, but it depends on the IDGrant, IDAnnuality and IDExpenseCategory (which are combo boxes)

This is what I wrote, but it is obviously wrong as it just returns the first Sottobudget (like there is no criteria)

Dlookup = ("Sottobudget","SottobudgetT", "IDGrant=" & [cboGrant] AND "IDAnnuality=" & [cboAnno] AND "IDExpenseCategory = " & [cboExpCat])

Can anybody help?

Thanks
Alex Hedley  @Reply  
           
4 years ago
Dlookup = ("Sottobudget","SottobudgetT", "IDGrant=" & [cboGrant] AND "IDAnnuality=" & [cboAnno] AND "IDExpenseCategory = " & [cboExpCat])

=Dlookup("Sottobudget","SottobudgetT", "IDGrant=" & [cboGrant] & " AND IDAnnuality=" & [cboAnno] & " AND IDExpenseCategory = " & [cboExpCat])
Ester Grande OP  @Reply  
    
4 years ago
Thanks a lot, obviously now it works

Can I ask you if it does work with the Dsum Function as well? Where I have to sum up expenses depending on the same multiple IDcriteria.

Thanks again for your quick help
Kevin Robertson  @Reply  
          
4 years ago
Also see: NZ Function
Ester Grande OP  @Reply  
    
4 years ago
Thanks
Alex Hedley  @Reply  
           
4 years ago
DSUM allows multiple criteria too, yes.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/8/2026 2:31:30 PM. PLT: 0s