Solved

How would I call a sub from another sub?

Posted on 2006-06-19
2
214 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

13 Experts available now in Live!

Get 1:1 Help Now