Solved

What is the difference between module and forms in vb?

Posted on 2008-10-08
3
194 Views
Last Modified: 2013-12-26
What is the difference between module and forms in vb?

when i open both in i can see the code !!

can u explain?
0
Comment
Question by:jaisonshereen
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
xDJR1875 earned 500 total points
ID: 22671541
A form is the graphical interface that the user will interact with. It can and usually does contain code specific to the controls that exist on the form. These might be buttons, listboxes, etc.

A module in vb is used to encapsulate code. At its purest form a module would contain code used for specific tasks and a new module would be used for other specific tasks.

In the past, I have created modules that contain utility routines that I find I use frequently. I can then include the module of my utility routines into any new project I have and reuse that code.

Code or functions/subs in a VB form can be addressed using the Me prefix. A module does not exist within a form, so that context is not available.

Hope this helps.

Dan
0
 

Author Comment

by:jaisonshereen
ID: 22671618
well thanks,

So a module is part of the entire application where forms resides right?

0
 
LVL 17

Expert Comment

by:xDJR1875
ID: 22671690
Yes, A module would be a part of the application.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 69
Add and format columns in vb6 7 47
Protecting vb6 & .Net code Obfuscation 18 99
clicking a shape in a frame array vb6 3 41
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

863 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

18 Experts available now in Live!

Get 1:1 Help Now