Stupid Question

bwk5502
08-26-2000, 12:42 AM
This question makes it obvious that I'm new at this VB stuff.

I have a VB project with only two forms and a module. I declared several functions in module1. Form1 can access the functions in module1, but form2 can't find any of the same functions. I get errors about functions not defined. Yet, everything else in form2 works fine. What goes?

SeiferTim
08-26-2000, 02:19 AM
Hmm... I don't know about that, Can you send me some of your code?

Visit my Web-Site: http://solenoid.50megs.com

Sparkey
08-26-2000, 08:13 PM
Did you declare the module variables with 'Option Explicit' and make them Public?

Would help us if you post your code.

bwk5502
08-26-2000, 09:55 PM
I added Option Explicit to module1 and made all procedures Public (I had it that way once before). Still didn't work.

To make this thing work, I created a third form (form3) and copied all my form2 stuff to form3. Then removed form2. Now it works. ???

Sparkey
08-26-2000, 10:09 PM
Weird!! Must have been something in form 2!! No point in trying to find out why it didn't work first time. You know the golden rule, "If it ain't broke - don't fix it!"

Anyway, glad you got it sorted

Nevvvv
08-28-2000, 05:47 PM
Just a bit of info on the side - for correct object orientated programming the functions in modules should always be private and therefore if u want to use them in different forms all u have to do is declare the module in each form under the option explicit statement. example:

option explicit
private m_Module1 as new Module1

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum