Has Module issue

D

Doc

I have had a re-occuring issue for quite a while, and have always just worked
around it, but am getting pretty annoyed with it.

On random forms, when the Has Module property is set to yes, the form begins
acting iratically. Functions that work great do not fire, or cause error
messages. Once the Has Module property is set to no, everything works like a
charm.

I usually end up rebuilding the form, but I'm getting sick of this. What's
going on, and is there a work around?
 
C

Chegu Tom

Doc

Can I assume that you have code in the form? Maybe some code that was built
when you made buttons? Are you using Access 2000 or 2002? I have had
similar problems in those versions

I have sometimes addressed a problem like this by deleting the suspect form
and importing from a backup

In the backup form
Open the VBA code in the form copy it and paste it to a notepad
Delete the code from the form
Set the has module to NO

Import the form into your current database
Open the form properties
Change the Has Module to Yes
Paste the code that you had stored in your notepad
Compile the code
Save the form
 
L

Linq Adams via AccessMonster.com

From Design View for the form, press <Ctrl> +G. This will take you to the
code module for the form. If all you see here is

Option Compare Database

then you have no code behind the form and can set Has Module to No. If there
are any subs listed, however, Has Module has to be set to Yes or they won't
run.

I agree Chegu Tom that it really sounds like corruption of the form(s) to me.
Setting Has Module to Yes really shouldn't cause a problem.
 
J

Jeff Boyce

Perhaps this is a symptom of corruption.

How do you have your database set up? Is it "split"? Is the front-end on
your PC?

Which version of Access?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Doc

Yes and no. The original state of the form does not have code in the form,
runs off of Public Modules. However, I have a bit of code the drops down
combo box lists when the user types or presses space, which has to be
initiated by the form. So the form works great, then I go to add code to the
form (and it doesn't matter if its a auto-generated button code, or my code
to drop the list), and the form corrupts.

I guess what my question should be is why does it happen, and how do I avoid
the corruptions?
 
D

Doc

Yes, it is split. I have several database that have a MDB backend, several
that have an SQL backend, and a couple new ones that are ADP's. Doesn't seem
to matter which the backend is, each of the systems have a randomly
corrupting form every now and again.

Running Win XP, Office 2003 SP2 (recently applied SP3 - no change in
symptoms)

--- Just had a thought, all of my forms are based off a 'Master Form',
meaning when I start a database project, I create the basic design of the
system, and create a 'Master Form' and a 'Master Report', then just copy and
paste the master form for all of the other forms I need. Could this be the
culprate? If so, why does it only happen to some forms and not all forms?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top