Can't access code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a a db with a few forms on them. Many of these have buttons with
code on them and they work fine however there is one form that I can't view
the code for in any way (eg Build event, Alt + F11).

Any ideas?
 
Hi, Andrew.
there is one form that I can't view
the code for in any way (eg Build event, Alt + F11).

Open the form in Design View and open the Properties dialog window. Select
the "Other" tab and look at the "Has Module" Property. If the property is
"No," then there is no module behind this form.

If the property is "Yes," then press <ALT><F11>, then <CTRL><R>. Scroll
down the list of forms in the Project Viewer and select your form's name,
then right click and select "View Code." Does the code module appear for
this form? If it doesn't, you probably have a corrupt form.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Hi Gunny,

I tried your suggestions and it appears the form is corrupt. I tried to
Compact and repair the DB but with no success.

Everything was ok and I think the last thing I did was change the caption.
I've also tried to add another button but I end up with an error "Subscript
out of range".

Any other ideas?
 
Hi, Andrew.
I tried your suggestions and it appears the form is corrupt. I tried to
Compact and repair the DB but with no success.

Create a new database file and import all objects except the corrupt form.
Import these objects one group at a time, first the tables, then the queries,
then the forms, et cetera.

If you have a recent backup, import this form from the backup and check the
form's module to see if it's okay. If it isn't, delete the form and try to
import the form from earlier backups until you find a good one. You may have
to redo some work if you restore from an old backup. When you're done
importing a good form from one of your backups, compact and repair the
database.

If you don't have a form you can restore from backup, create a new, blank
form in the new database file. Open the old database file and open the
corrupt form in Design View. Select all the controls on the form and copy
them, then paste them onto the new form in the new database. Save the new
form. You'll have to rewrite all the code in the procedures in that form's
module, but you shouldn't have any more corruption.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Hi Gunny,

I'm waiting for the Administrator to give me the backups and then I'll try
your suggestions - thanks for your help to date.
 
Hi Gunny,

I have had the file reinstated from a backup however I have a problem where
I can open the form, change Record Source but I can't save the changes. I
think it thinks there is someone in it (definately not) or some code it
running but this is not the case.

I have compacted and repaired the DB but no go.

Any ideas? I am now about to do your suggestion from yesterday.


I will
 
Hi, Andrew.
I can open the form, change Record Source but I can't save the changes. I
think it thinks there is someone in it (definately not)

If you don't have exclusive access to the file, you won't be able to save the
changes to the form. When no one else is connected, the problem is often due to
VBA code opening a second Database object in the default Workspace, which will
show as a second connection to your file from your computer.

Once you open the file, use the LDB Viewer to check the connection. Open the
form in Design View and if there's a second connection from your computer to the
application file, the LDB Viewer will show this. You may find a link to the LDB
Viewer and other free diagnostic tools in the "Free Microsoft Access
Troubleshooting Tools" section on this Web page:

http://www.Access.QBuilt.com/html/links.html

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 
Back
Top