Solved

How to call a subroutine located in a different form

Posted on 2002-07-02
3
164 Views
Last Modified: 2010-05-02
How can I call a subroutine that in a totally different form?
0
Comment
Question by:Draner
  • 2
3 Comments
 
LVL 69

Expert Comment

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

FormName.SubRoutineName
0
 

Accepted Solution

by:
carlosferreira earned 50 total points
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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

IT, Stop Being Called Into Every Meeting

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 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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

11 Experts available now in Live!

Get 1:1 Help Now