PC Review


Reply
Thread Tools Rate Thread

Call a macro from another form ?

 
 
SpookiePower
Guest
Posts: n/a
 
      20th Feb 2006
I have two forms - a mainform with a subform on it.

Most of my code are on the main form, but I have startede to wirte
some code on the subform. In the code on the subform I need to call
some code from my main form. How can I do that ?
I can remember from my old Delphi Pascal days, that you must include
units to get access to code from other places, but how can I do it here
??

www.photo.activewebsite.dk

 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2NoYXN0ZWVu?=
Guest
Posts: n/a
 
      20th Feb 2006
For functions / sub make sure you use the word Public instead of Private at
the start. then you can use:
Call FunctionName(variables that need passed)
or if the function returns a value
Me![text1] = FunctionName(...)


"SpookiePower" wrote:

> I have two forms - a mainform with a subform on it.
>
> Most of my code are on the main form, but I have startede to wirte
> some code on the subform. In the code on the subform I need to call
> some code from my main form. How can I do that ?
> I can remember from my old Delphi Pascal days, that you must include
> units to get access to code from other places, but how can I do it here
> ??
>
> www.photo.activewebsite.dk
>
>

 
Reply With Quote
 
SpookiePower
Guest
Posts: n/a
 
      20th Feb 2006
Sorry..

It is a procedure (sub) I'm trying to call, not a macro.

 
Reply With Quote
 
=?Utf-8?B?c2NoYXN0ZWVu?=
Guest
Posts: n/a
 
      20th Feb 2006
That was for a procedure or a function. I tried to read between the lines.
I don't do anything with macros

"SpookiePower" wrote:

> Sorry..
>
> It is a procedure (sub) I'm trying to call, not a macro.
>
>

 
Reply With Quote
 
Phillip Windell
Guest
Posts: n/a
 
      20th Feb 2006
I think if you have a Proceedure that you may want to "re-use" on other
forms, it would be best to place the proceedure into a Code Module.

--
Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com

"SpookiePower" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry..
>
> It is a procedure (sub) I'm trying to call, not a macro.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook custom form - VBS call VBA macro JMat45 Microsoft Outlook Form Programming 4 11th Jan 2012 07:12 PM
Call a javascript when i call an aspx page with a form html not running on server Fabio Mastria Microsoft ASP .NET 4 28th Jan 2008 09:05 AM
call macro to format form David Adamson Microsoft Excel Programming 0 7th Aug 2006 06:58 AM
How Can I call any form or macro.. =?Utf-8?B?VmljdG9y?= Microsoft Excel Worksheet Functions 1 16th Nov 2005 08:42 AM
How can I call a macro or form. in the moment that enable any shee =?Utf-8?B?VmljdG9y?= Microsoft Excel Worksheet Functions 1 16th Nov 2005 08:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:04 PM.