Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 February 3rd, 2011, 12:58 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default 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
 
Old February 3rd, 2011, 02:37 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

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..
 
Old February 3rd, 2011, 03:28 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default 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
 
Old February 3rd, 2011, 04:45 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Quote:
Originally Posted by cindyl View Post
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
 
Old February 3rd, 2011, 04:56 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default

Yes, we have Office 2007 SP2 installed.

Thanks,
Cindy
 
Old February 3rd, 2011, 05:33 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

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
 
Old February 7th, 2011, 11:10 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Chpt.2-Wrox File Share is missing Default.aspx and Default.aspx.vb bzoni BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 23rd, 2009 02:39 PM
MS Access help - VB Code for command button pari22 Access VBA 11 September 7th, 2007 11:13 AM
Processing Excel VB code from Access Axxess Pro VB Databases 0 July 4th, 2007 04:12 AM
VB version Global.asax missing some code Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 29th, 2007 02:23 PM
Read Linked tables in Access from VB code meggan VB Databases Basics 3 March 4th, 2005 11:26 AM





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