[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to call a subroutine located in a different form

Posted on 2002-07-02
3
Medium Priority
?
177 Views
Last Modified: 2010-05-02
How can I call a subroutine that in a totally different form?
0
Comment
Question by:Draner
[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
3 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7125674
the subroutine needs to be public and you call it this way:

FormName.SubRoutineName
0
 

Accepted Solution

by:
carlosferreira earned 200 total points
ID: 7125713
In the form which has the subroutine you want to call ensure that the subroutine is Public.  

eg.
Public Hello()
  MsgBox "Hello World"
End Sub

For sake of arguement also call this form "FormWithRoutine"

In the form you are calling from type the name of the Form with the subroutine, type a period, and the specify the name of the Routine you which to call.  In the example given above it would be:

FormWithRoutine.Hello
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7125716
another newbie!!!

carlosferreira, your post is not an answer. You can read at the bottom of this screen :
"Answers
An answer is a specific solution to a question and should be submitted if it will solve the questioner's problem and doesn't duplicate a previous comment. "

Also, you made a mistake. It should be read: Public SUB Hello()
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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