PC Review


Reply
Thread Tools Rate Thread

Creating Modules

 
 
=?Utf-8?B?S0lTU25BQ0RD?=
Guest
Posts: n/a
 
      19th Jul 2007
How do I create a new module?
I've tried so many things and no matter what I type in the module, it's wrong.

Assume I haven't tried anything (be detailed), I just need to know what I'm
missing.
 
Reply With Quote
 
 
 
 
Scott McDaniel
Guest
Posts: n/a
 
      19th Jul 2007
On Thu, 19 Jul 2007 12:38:02 -0700, KISSnACDC <(E-Mail Removed)> wrote:

>How do I create a new module?
>I've tried so many things and no matter what I type in the module, it's wrong.


Do you mean a Standard Module? You can create one from the database window (the one with the listing of the Tables,
Forms, etc) by clicking Modules, then New ... this will create a new Standard Module named Module1. You can rename it,
of course.

From there you'd add your Subs and Functions. A Sub or Function always has a Header and Footer:

Sub MySub()
<your code here>
End Sub

Function MyFunction(SomeInputValue As String) As Boolean
<your code here>
End Function

You can also add Constants and such at the beginning, in the General Declarations section:

Private mflgDirty As Boolean

Const conIsNew As Long = 1

Unlike a Class module, you don't need to do anything special to call a Sub or Function from a Module, you simply do
this:

If MyFunction("Tommy Boy") Then
MsgBox "Right On!!"
End If

>
>Assume I haven't tried anything (be detailed), I just need to know what I'm
>missing.


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
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
Public Variables, Class Modules and Standard Modules Excel Monkey Microsoft Excel Programming 2 30th Apr 2009 03:18 PM
Guideline for creating reusable modules ? Larry Microsoft Access VBA Modules 1 12th Sep 2008 07:42 AM
DotNetNuke - Creating Modules that use other usercontrols David Rose Microsoft ASP .NET 0 10th Oct 2005 09:45 AM
Basic question - modules and class modules - what's the difference? Mark Stephens Microsoft Excel Programming 9 8th May 2005 11:48 AM
Viewing modules on forms displays All form modules Clyde Ellingwood Microsoft Access Form Coding 0 24th Feb 2004 09:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 AM.