Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3601884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:40:35+00:00 2026-05-18T20:40:35+00:00

I’m new to VB (using VBA, actually) and I would like to force an

  • 0

I’m new to VB (using VBA, actually) and I would like to force an event to fire. Specifically, I am updating the value in a textbox and I would like to call that textbox’s AfterUpdate() event.

Private Sub cmdCreateInvoice_Click()
  Me.txtInvDate = '11/01/10'
  Me.txtInvDate.AfterUpdate
End Sub

During run time, I get an error that says “Compile Error: Invalid Use of Property”. If I try something similar, but with the click event (ex: cmdCreateInvoice.Click), which does NOT have a property that shares the name, I get an error that says “Compile Error: Method or Data member not found”.
I know there must be a way to fire one event from another. But what is the proper syntax?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:40:36+00:00Added an answer on May 18, 2026 at 8:40 pm

    AFAIK, there is no way to “fire an event manually” in VB(A). What you can do is call the event handler manually, and for this, rdkleine has given you the answer already:

    Call txtInvDate_AfterUpdate()
    

    This will have exactly the same effect as if the event had fired (though it does not give you the whole chain of events that may also fire along with it–unless you Call their handlers as well).

    IgorM has another valid point, in comments on his answer–it’s “cleaner” to write a different Sub to do the work you want done, then call it from both the event handler & wherever you’re trying to do it now (button click?). So:

    Private Sub txtInvDate_AfterUpdate()
        DoWhatever
    End Sub
    
    Private Sub button_Click()
        DoWhatever
    End Sub
    
    Private Sub DoWhatever
        'your desired effect
    End Sub
    

    You could even make DoWhatever a Public Sub in a Module.

    Edit

    And no, in VB(A) it doesn’t matter what order you define your Sub (or Function) routines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.