Solved

How to FIRE Button_Click from other SUB

Posted on 2004-08-18
3
193 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 125 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 - SQL Timeout 9 51
DataGridView / get bound table name? 8 36
Access/Visual Basic Question 3 42
YouTube API get the Video Tags - vb.net 7 31
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…

749 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