Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2004, 12:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access VBA

Every time I try to execute VBA code on my XP Pro machine, I get the following error message. It also happens when I try to edit VBA modules.

 
Quote:
quote: Microsoft Visual Basic
Quote:

             Error accessing file. Network connection may have been lost.
How do I fix this? Do I need to re-install any .dll's?


Rand
__________________
Rand
 
Old March 25th, 2004, 03:52 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Internally, access keeps a reference to the files used for string VBA code. Some times this references get corrupted and access can not find the file, even if you can open the code. This happens a lot (almost every time) when an access object that contains code gets imported into a database. Always remove the code from the object before importing into an access database.
The only way to fix this is to create a new database and import all of your objects into it. Copy the code into separate text files and under the object properties in design view, select hasmodule and click no.

Make a good backup before you begin this process. Yes, this has happened to me many times. :(




Sal
 
Old March 25th, 2004, 06:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This sounds like a bug/feature to me.

Does MS have a bugfix/patch to solve this?

I use and re-use VB modules in many databases. This makes it a real pain to re-use code. I might as well be using PC File!



Rand
 
Old March 25th, 2004, 09:13 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use code modules more. This can be imported with no problem. Access is a good program, but it tries to do too much, and sometimes overtasking will kill you.

I use am using access more for the reporting than the forms. I do not keep data in access whenever possible.

make sure to decompile your file as well. This will reduce the possibility of bugs in your code. Do a search on this forum for "decompile" I do not remember it from the top of my head, but you run it from the command line.

Good luck.



Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
Access VBA Teqlump Access 2 September 10th, 2004 02:33 PM
Access vba rookieat this Access VBA 6 February 7th, 2004 03:01 PM
Access VBA help danielwajnberg Access VBA 3 September 1st, 2003 09:46 AM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.