UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Quick Question Re: Form Modules, Access 2016    
 
   
Art_Of_War
post Dec 28 2017, 10:22 PM
Post#1



Posts: 15
Joined: 4-December 17



Hi ladies and gents,

I recently bought the book Microsoft Access 2016 Programming Primer by Julitta Korol, and have been working through it steadily over the past few weeks. I've just got a question regarding the validity of a statement the author has made in the opening chapter. She says,

"Each Access form can contain a form module."

Is this correct, or is it more accurate to say that each Access form can contain multiple modules (in the various event procedures of the Properties Sheet)?
Go to the top of the page
 
theDBguy
post Dec 28 2017, 10:36 PM
Post#2


Access Wiki and Forums Moderator
Posts: 71,915
Joined: 19-June 07
From: SunnySandyEggo


Hi,

I think she's correct, but I would probably phrase it more like: "Every Form can have a Class Module."

If it does, the Has Module property will be set to Yes.

Just my 2 cents...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
GroverParkGeorge
post Dec 29 2017, 08:10 AM
Post#3


UA Admin
Posts: 32,357
Joined: 20-June 02
From: Newcastle, WA


I agree with theDBguy.

You need to differentiate between a "module" and a "procedure".

Modules are containers in which one or more procedures can be written.

By default, forms are created with modules. These are empty containers until you, the developer add one or more procedures to them. You do this either by selecting one of the events attached to a control, or to the form itself, or by creating subs or functions in the module.

You can remove the module--along with any procedures within it--by toggling the property as theDBguy pointed out. If you change it to No, the module and all of the procedures in it are removed.

--------------------
Go to the top of the page
 
JonSmith
post Dec 29 2017, 11:41 AM
Post#4



Posts: 3,280
Joined: 19-October 10



Its totally correct, all of those event procedures you mention are in the same single module, if they weren't they wouldn't work.

Dbguy is correct aswell as the form module is technically a class module as the form can be used as a class and called multiple times at the same time.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th April 2018 - 10:24 PM