Strange Problems with VBA

D

David C. Holley

Something weird is going on. I was in the process of debuging a form
(frmReservations) in Access. As a part of this, I created a copy of the
form (frmReservations_backup). Once I had figured out the problem with
the original. I deleted it and then went to rename the _backup to the
original. At first, Access really didn't like that indicating that a
form by that name already existed, although I had deleted it and it
didn't appear in the DB window. Then when I tried to view the VBA code
for the backup, Access started through an error message - "Error
accessing code. The connection to the network might have been lost."

I did a compact and repair on the db file, which didn't work. I then
imported the form into a fresh db file, which seemed to fix the problem,
but then when I started working with a function in a module that I
exported and imported, Access would throw the error message at me when I
tried to ADD parameters to a sub.

I've already done a uninstall/reinstall of ALL of Office on the chance
that this would fix it, but it didn't.

I think that the problem possibly has something to do with specific DB
files as opposed to Access and may just flat out import/export
everything (ARGGGG!!!) but its just plain strange.

Any ideas?

FYI: Office 2000 Pro on WinXP

David H
Come on baby lite my fire: www.spreadFirefox.com
 
D

David C. Holley

Additional information...
The modules containing the FORM-related code are not being deleted when
I delete the forms from the DB. This occurred in a freshly created *.mdb
file.

David H
 
J

Jim Vierra

If you open a form (run a form) it will be saved in memory unless you
destroy it. This causes a conflict when you try to rename a form to the
name of a previously deleted but once activiated form. Find the form in the
"Forms" collection or run the test form and save a reference to the object
globaly or in a global collection. Then after closing the form and deleting
it you can find the reference and destroy the form and set it's reference to
Nothing.

You must be sure that no other form has been run that contains a reference
to the form you are trying to replace.
 

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