Computer Learning Zone CLZ Access Excel Word Windows

Work is the best therapy - at least for your employees.

-63rd Rule of Acquisition
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Microsoft Access 302    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
I have Some Problem with the dlookup function
david 
    
16 years ago
Dear Richord

I Follow Your excellent course and i try to make with my own the dlookup function, but i do not succeed, and every item in the ProductT that is taxable but  dont have a taxoverride value it's dont show a tax value, even that the form  have a tax default value.
i copy there my vb code:
Private Sub AddProduct_Click()

On Error Resume Next

Dim IsTaxable As Boolean
Dim SpecialTaxRate


DoCmd.GoToRecord , , acNewRec
Description = ListProduct.Column(1)
ItemPrice = ListProduct.Column(2)
ProductId = ListProduct.Column(0)
Notes = DLookup("note", "productT", "productid=" & "listproduct")

IsTaxable = DLookup("taxable", "productT", "ProductID=" & "listproduct")
SpecialTaxRate = DLookup("TaxOVerRide", "ProductT", "ProductID=" & "listproduct")
If IsTaxable = False Then TaxRate = 0
If Not IsNull(SpecialTaxRate) Then TaxRate = SpecialTaxRate





End Sub




Reply from Richard Rost:

Fix these three lines:

Notes = DLookup("note", "productT", "productid=" & "listproduct")
IsTaxable = DLookup("taxable", "productT", "ProductID=" & "listproduct")
SpecialTaxRate = DLookup("TaxOVerRide", "ProductT", "ProductID=" & "listproduct")

to this:

Notes = DLookup("note", "productT", "productid=" & listproduct)
IsTaxable = DLookup("taxable", "productT", "ProductID=" & listproduct)
SpecialTaxRate = DLookup("TaxOVerRide", "ProductT", "ProductID=" & listproduct)

Remember, you're sending the VALUE of the ListProduct box to the DLOOKUP function... not the WORD "listproduct". So it should NOT be in quotes.

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

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: 5/22/2026 6:29:32 AM. PLT: 0s