Solved

passing the name of a procedure via a variable

Posted on 2006-07-10
2
204 Views
Last Modified: 2010-04-23
what is the easiest way to perform something similar to:

****
Dim var1 as String
Call var1
****

to excecute procedure Proc1?
0
Comment
Question by:the_bachelor
2 Comments
 
LVL 2

Expert Comment

by:TheUnkind
ID: 17078172
try this one

dim proc2 as new proc1



0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 50 total points
ID: 17078240
Here's an example, using CallByName:

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    CallByName(Me, "Test", CallType.Method, New Object() {})

  End Sub

  Public Sub Test()
    MessageBox.Show("Test")
  End Sub

Bob
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video discusses moving either the default database or any database to a new volume.
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…

758 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

22 Experts available now in Live!

Get 1:1 Help Now