473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Calling the subroutine from another form

I am calling the sub from another form. I have a MDI form with buttons such as new, open, save, print, print preview. i have also 30-50 child forms with respective Subroutines new, open, save... When NEW button is clicked, i want to call the NEW subroutine of that form performing the defined action. thanks
Sep 28 '11 #1
1 1807
Guido Geurs
767 Expert 512MB
Put the sub in a module and call it from the MDIform and the form

MDIform:
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComMDIform1_Click()
  2.    Call Message
  3. End Sub
Form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComForm1_Click()
  2.    Call Message
  3. End Sub
Module:
Expand|Select|Wrap|Line Numbers
  1. Public Function Message()
  2.    MsgBox "hello"
  3. End Function
Sep 29 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris | last post by:
Hi, Is it possible to start a subroutine in for example (frmMainForm) from another form (frmSubForm)? I want to start a subroutine called cmdButton1_Click. I wrote (in frmSubForm): ...
1
by: Michael S. Montoya | last post by:
I need to have a form's routine run from another form...here is an example: frmContacts is loaded. The user double-clicks cboCompanyID to open frmCompany frmCompany displays other contacts for...
4
by: Sandy MacDonald | last post by:
Hi everyone, This is a very simple question, but I am new to VB.net and can't seem to get a simple call to another form to work. example: If (scenerio is true) then load frmLogin end if ...
7
by: Geoff Jones | last post by:
Hi Could somebody give me an example of a way to call another member function of another form from a form that has been called using ShowDialog? Thanks Geoff
6
by: Leszek | last post by:
Hi. I wrote a script: function zmiana(ile){ while(document.getElementById('accomp').childNodes.length>1){ ostatni=document.getElementById('document.dane.accomp').lastChild;...
2
by: planetthoughtful | last post by:
Hi All, I have a calendar form that updates a date field on the form from which it was called. I have code in the OnChange event of the date field that I would like performed whenever the date...
1
by: gordon | last post by:
Hi I have a form that has a button that i would like to use to open another form (the second form will contain a text box for free text input). When the user types some text in the text box and...
4
by: Gerhard | last post by:
I have an MS Access app with multiple forms. One of the forms has a Toolbar (MsComctlLib.Toolbar) and it works as advertised. I handle the buttons in the Toolbar1_ButtonClick event. I would like...
4
by: sajit | last post by:
hi folks, I am curently working in vb.net 2005. I am stuck at one technical glitch. How to open another form and close the parent foem in vb.net. I have tried every thing like me.close as well...
2
by: kronecker | last post by:
Sounds simple enough when I do Form2.Hide() calling this from Form1 it closes fine (or hides) However, I have a form which is called from another form say Form3 which is called from Form2 and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.