Solved

How to FIRE Button_Click from other SUB

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get Client IP on RDS - VB.NET 15 67
get row value in vb.net 4 17
Iteration Help (Asp.net VB) 5 24
MailAddress in vb 4 29
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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 Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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