Solved

How would I call a sub from another sub?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

8 Experts available now in Live!

Get 1:1 Help Now