Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   Courses   Seminars   Templates   Help   TechHelp   Forums   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > AfterUpdate < Turn Off Warnings | NZ >
 
AfterUpdate
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   14 months ago

AfterUpdate Event & DLookup - Look up Values from Table to a Form


 S  M  L  XL  FS  Join Now

In this Microsoft Access tutorial, I will show you how to look up and auto populate fields in a form using the DLookup function and the AfterUpdate event in VBA (Visual Basic). Don't worry if you've never done any programming before. I'll take it step by step.

Chris (Gold Member) asks, "I assign zone numbers to customers based on the state the customer is in. However, this isn’t a rule. There may be exceptions, such as if a sales rep brings in a new customer from out of his zone. Is there a way to automatically fill in the default zone for the customer when I enter his state, but still be able to change it?"

Members

I'll show you how to prompt the user for the Zone number if the State isn't found in the table. We will learn how to use the InputBox, NZ, CInt, and IsNumber functions, and learn about type casting.

Silver Members and up get access to an Extended Cut of this video. Gold Members can download the database template from class plus get access to the Code Vault. If you signed up on YouTube you have to contact me so I can set up your account here on my web site. If you're not a member, Join Today!

Learn More

AfterUpdate events are taught in detail in my Access Developer 1 class.

Links

AfterUpdate Events: https://599cd.com/afterupdate
DLookup Function: https://599cd.com/dlookup
AutoNumbers: https://599cd.com/autonumber
String Concatenation: https://599cd.com/concatenation
Excel VLOOKUP: https://599cd.com/vlookup
Excel XLOOKUP: https://599cd.com/xxlookup
InputBox Function:  https://599cd.com/inputbox
NZ Function: https://599cd.com/nz
Type Casting: https://599cd.com/type+conversion
CInt Function: https://599cd.com/cint
IsNumeric Function: https://599cd.com/isnumeric
DoCmd.RunSQL: https://599cd.com/runsql
DoCmd.SetWarnings: https://599cd.com/setwarnings
SQL Seminar: https://599cd.com/sql

Learn More

FREE Access Beginner Level 1
Access Level 2 for $1.00

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Mailing List - Get Emails When New Videos Released!
Consulting - Need Help with Your Database?

Questions?

Please feel free to post your questions or comments below or submit them via the TechHelp page.

 

Passing a string to the parent Upload Images   Link 
Despina Karayanni 
7 months ago
Hello,
I'd very much appreciate if you could advise about how may I transfer a string to the parent field, instead of the numeric value. I've tried very much, however I cannot succeed to any results. Best, Despina
Richard Rost
7 months ago
I'm sorry, but I don't understand what you mean by transferring a string to the parent field. Are you trying to use a string value as the criteria?
Despina Karayanni
7 months ago
Hello,
I use the code of update and dlookup ( I fill in the Address in OrderF and I want to update the Address of the CustomerT (a string field).
Furthermore, the variable that I have, in the place of 'State', in your example, is a Combo, the 'Combo22'.
So, I have unsuccessfully adopted your code. Do you have listed a specific lesson, or something relevant, for updating fields that are string, and not numeric?
Thank you very much.
Add a Reply
AfterUpdate Brain Wrecking Upload Images   Link 
Pete Santiago 
8 months ago
I'm working on a Pop Reminder for User to input number  of [DaysToCall] to followup from a [XDateToCall].

AfterUpdate works great with this:
Private Sub DaysToCall_AfterUpdate()
Read More...
Richard Rost
8 months ago
How about:

Private Sub DaysToCall_AfterUpdate()
    If IsNull(DaysToCall) then DaysToCall = 1
    XDateToCall = Date + DaysToCall
End Sub


Remember, you don't need to use DateAdd for days. Just add whole numbers. Save DateAdd for weird stuff like months or years.
Pete Santiago
8 months ago
It worked of course!!!  Thank you so much!  I should have stepped away hours ago...UGH!...Thank you again for what you do!
Add a Reply

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

10/10/2021Copy Text from Field
10/10/2021Access for Free
10/9/2021Birthdays
10/8/2021Label Resize
10/2/2021Criticisms of Access
10/1/2021Access Developer 32
10/1/2021Groups
9/29/2021DMin
9/28/2021Track Log On
9/26/2021Sliders
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn
Keywords: TechHelp Access afterupdate dlookup   PermaLink