Solved

What is the difference between module and forms in vb?

Posted on 2008-10-08
3
190 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

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

744 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

14 Experts available now in Live!

Get 1:1 Help Now