Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Home > Forums > Access Forum > DLookup in AfterUpdate by Edward Mastoloni
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
DLookup in AfterUpdate
Edward Mastoloni 
     
5 years ago
I have a form "PriceCheckF" where after the user selects an item (which is a combo box field named = ItemNumberCombo on form PriceCheckF), I want to go find the "Increment" from the table "WebItem" where ItemNumberCombo = ItemNo (from the WebItem table).  

ItenNumberCombo is a field on the form "PriceCheckF"
Increment1 is a field on the form "PriceCheckF"

ItemNo is a value stored in the table WebItem
Increment is a value stored in the table WebItem

Here is what I have and it's not working.

Private Sub ItemNumberCombo_AfterUpdate()

Me.Increment1 = DLookup("Increment", "WebItem", "ItemNo=" & [ItemNumberCombo])

End Sub

Kevin Robertson  @Reply  
          
5 years ago
Is ItemNo the bound column of the combobox? If not you may need to reference the Column property. For example, ItemNumberCombo.Column(1).
Edward Mastoloni OP  @Reply  
     
5 years ago
Yes, ItemNo is the bound column of the combobox
Edward Mastoloni OP  @Reply  
     
5 years ago

Edward Mastoloni OP  @Reply  
     
5 years ago

Edward Mastoloni OP  @Reply  
     
5 years ago

Kevin Robertson  @Reply  
          
5 years ago
You need to tell your DLookup function that you are sending text.

Increment1 = DLookup("Increment", "WebItem", "ItemNo=""" & ItemNumberCombo & """)

Double Double Quotes
Edward Mastoloni OP  @Reply  
     
5 years ago
That didn't work either
Edward Mastoloni OP  @Reply  
     
5 years ago

Edward Mastoloni OP  @Reply  
     
5 years ago
SUCCESS...   This WORKED

Private Sub ItemNumberCombo_AfterUpdate()

Me.Increment1 = DLookup("Increment", "WebItem", "ItemNo='" & ItemNumberCombo & "'")

End Sub
Edward Mastoloni OP  @Reply  
     
5 years ago

Edward Mastoloni OP  @Reply  
     
5 years ago
Robert, after watching Richard's video and looking at what you wrote, it helped to use a single quote in the expression.  I think you had one too many double quotes (3 double quotes) after ItemNo=
Alex Hedley  @Reply  
           
5 years ago
Is Item number a string and not a number?
Edward Mastoloni OP  @Reply  
     
5 years ago
Its an alpha numeric field so it's a string
Richard Rost  @Reply  
          
5 years ago
You can use either a single quote or double double quotes. I prefer the latter because you're more likely to run into a string with a ' in it, like last names: "D'Angelo"

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

Next Unseen

 
 
What's This?

 

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: 9/12/2026 7:12:43 PM. PLT: 1s