Solved

How to FIRE Button_Click from other SUB

Posted on 2004-08-18
3
191 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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