Solved

How would I call a sub from another sub?

Posted on 2006-06-19
2
217 Views
Last Modified: 2010-04-23
I have ar question.  How do I call a sub from another sub in a form?

I want to call the sub btnFileFind1_Click from mnuOpen_Click..SEE BELOW:

 Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
        Dim filefindopen As String

    End Sub

 Private Sub btnFileFind1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFileFind1.Click

        Dim strFileName As String

        OpenFD.InitialDirectory = "C:\PRU401k"
        OpenFD.Title = "Open a text file"
        OpenFD.Filter = "Text Files(*.txt)|*******R.txt"
        OpenFD.ShowDialog()

        strFileName = OpenFD.FileName
        MsgBox(strFileName)
        TextBox1.Text = strFileName
    End Sub
0
Comment
Question by:VBBRett
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 16932519
btnFileFind1.PerformClick();

Or:

btnFileFind1_Click(sender, e);
0
 

Author Comment

by:VBBRett
ID: 16932634
AlexFM the GENIUS gets 500 points.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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 …
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 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