Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Afterupdate Revisited
Tanin Uthayanaka 
   
14 months ago
Hi,

Before I begin, I did read about AfterUpdate in this forum (https://599cd.com/blog/display-comment.asp?CommentID=78027) and the net but it didnt work for me.

I have an order form with a ComboBox of customers which calls a popup form (by double clicking) to search and pick a customer.

In the ComboBox of the order form, I declared the AfterUpdate event "Public" but got the error 2465 Application or Object defined error.

The command I used in the popup form to trigger afterupdate event in the order form is:

Forms!frmOrderDetails.Form.cboCustomerID_AfterUpdate

NOTE: I was able to successfully use the same command when calling from a subform to a popup form.

Thank you in advance,
Tanin
Julie Bennett  @Reply  
     
14 months ago
Can you please send a copy of all of the After Update code?  
Tanin Uthayanaka OP  @Reply  
   
14 months ago
Public Sub cboCustomerID_AfterUpdate()
    'Created by Tanin Uthayanaka
    txtOrderSalesTaxRate = cboCustomerID.Column(3)
    txtOrderDiscountRate = cboCustomerID.Column(4)
    txtCustomerCommission = cboCustomerID.Column(5)
End Sub
Kevin Robertson  @Reply  
           
14 months ago
Create a Public Sub (leave AfterUpdate event Private to that Form) then you can call it from any Form as long as the Form with the Public Sub is open. A better solution is to put the code in a Global Module so it can be called from anywhere without relying on the Form being open.

Example
    Public Sub MyData()
    
        MsgBox "Hi There Dude!"
    
    End Sub


If in an open Form:
    Forms!YourFormName.MyData

If in a Global Module:
    MyData
Tanin Uthayanaka OP  @Reply  
   
14 months ago
Hi,

Following your concept.

The following works for me but it doesn't really explain why I can't call the AfterUpdate event directly when declaring it Public

Public Sub UpdateCustomerComboBox()
    'Created by Tanin Uthayanaka
    txtOrderSalesTaxRate = cboCustomerID.Column(3)
    txtOrderDiscountRate = cboCustomerID.Column(4)
    txtCustomerCommission = cboCustomerID.Column(5)
End Sub

Private Sub cboCustomerID_AfterUpdate()
    'Created by Tanin Uthayanaka
    UpdateCustomerComboBox
End Sub

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: 5/6/2026 8:28:55 AM. PLT: 0s