Solved

How would I call a sub from another sub?

Posted on 2006-06-19
2
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 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