 |
| 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
|
|
|
|

February 3rd, 2011, 12:58 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Why all of my VB code are missing in Access
Hello Everyone,
One of my Access database was not working yesterday, and I found out the reason: because all of my VB code were missing from Fomrs, Reports, Modules..
My questions are:
1. Why did it happen?
2. How can repair the problem (I used the backup DB to replace it)?
Thanks,
Cindy
|
|

February 3rd, 2011, 02:37 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
Sounds like you corrupted the VBA code.
What version of Access including SP level?
Is your database split? if not I would do this ASAP. See: Splitting your Access database into application and data
Converter the front end to an MDE/ACCDE for production use.
I make a backup for every front end master (.mdb/accdb) before I open it to make changes.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
Last edited by HiTechCoach; February 3rd, 2011 at 02:39 PM..
|
|

February 3rd, 2011, 03:28 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Thanks, HiTechCoach
I put the database in the network server.
Server: Window server 2003, SP2;
work station: Window XP SP3;
Access database: 2007
our database is not splited, I will go to that link to study it.
Thanks,
Cindy
|
|

February 3rd, 2011, 04:45 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
Quote:
Originally Posted by cindyl
I put the database in the network server.
Server: Window server 2003, SP2;
work station: Window XP SP3;
Access database: 2007
our database is not splited, I will go to that link to study it.
Thanks,
Cindy
|
Cindy,
Thanks for the information. It would really help to know what version of Access you have installed (running).
See: Where is the About dialog for Office 2007 applications
I would make sure that you have Office 2007 SP2 installed.
Having multiple computers opening the same (shared) database from a file share can definitely cause issues like database corruption.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
|
|

February 3rd, 2011, 04:56 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Yes, we have Office 2007 SP2 installed.
Thanks,
Cindy
|
|

February 3rd, 2011, 05:33 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
I would make sure that every computer has the SP2 update installed. It is possible if just one computer does not have SP2 installed and it opens the database you could have problems.
Every database I have developed, work on, or will even use is always split. I also only use a complied MDE or ACCDE (2007/2010) front end for any production work. This also prevents the VBA code from getting corrupted.
Back with Access 2000 there was an issue with the VBA editor. When you paste VBA code and did not manually run a compile it could corrupt the VBA code for the entire databases when you exited. For over 10 years I have developed a really good habit of always manually compiling the VBA code whenever I am in the VBA editor. Since I started doing this years ago I have not had any more issues with the VBA code getting corrupted in a mdb or accdb.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
|
|

February 7th, 2011, 11:10 AM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Thank you, HiTechCoach
Thank you so much, HiTechCoach.
I will ask the end users to check 2007 SP2 installed, and also consider your suggestion.
You are great!
Cindy
|
|
 |