Solved

What is the difference between module and forms in vb?

Posted on 2008-10-08
3
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Daniel Reynolds 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:Daniel Reynolds
ID: 22671690
Yes, A module would be a part of the application.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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