?
Solved

How to FIRE Button_Click from other SUB

Posted on 2004-08-18
3
Medium Priority
?
195 Views
Last Modified: 2010-04-23
I have a button called btnSAVE and a button called btnADDItem....

...on Click of btnADD, I want to fire btnSAVE based on a condition....

'**************************************
    'User wants to add a new Item to an AFE
    '**************************************
    Private Sub btnAddItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddItem.Click
        Dim frmAFEDetail As frmAFEDetail = New frmAFEDetail

        'Open Branch form and initialize
        frmAFEDetail.txtHiddenID.Text = "NOID" 'Means it is an ADD
        frmAFEDetail.txtHiddenID2.Text = txtHiddenID.Text 'Send the header ID for FK
        frmAFEDetail.lblEdit.Text = "Add Mode"
        frmAFEDetail.ShowDialog()

        oDsGrid.Reset()
        LoadDataGrid()

        _bolRefreshMain = True 'Reset the refresh flag

        Me.Activate()
    End Sub

'**************************
    'User wants to SAVE an AFE to Report
    '**************************
    Private Sub btnSAVE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrintAFE.Click
           BLAH BLAH BLAH
    End Sub

Where in btnADDItem_Click would I put the code and what would I put to invoke bthSAVE_Click....so that after the btnSAVE event fires...code resumes in btnADDItem_Click....
0
Comment
Question by:natloz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11833244
use...  btnSAVE_Click(Nothing,Nothing)   , where ever you want to keep it.
-Baan
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 11833262
for example...
If (condition) Then
   btnSAVE_Click(Nothing,Nothing)
End If

-Baan
0
 
LVL 7

Author Comment

by:natloz
ID: 11833591
Works like a charm...thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question