Solved

How to FIRE Button_Click from other SUB

Posted on 2004-08-18
3
190 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
Comment Utility
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
Comment Utility
for example...
If (condition) Then
   btnSAVE_Click(Nothing,Nothing)
End If

-Baan
0
 
LVL 7

Author Comment

by:natloz
Comment Utility
Works like a charm...thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now