Solved

VBA not working on other computers - works on mine.

Posted on 2011-03-14
20
310 Views
Last Modified: 2013-11-27
I have a form that works great on my desktop but when I try to open it on any other computer it doesn't work. I can't for the life of me figure out what would cause this. I have on module with functions I call from the main form. The computers are all running 2007 on XP. Can someone tell me what would cause this kind of thing?

On the form 'frmMoldChanges' click in any textbox and it should open another form. It works PERFECTLY on the PC I created it on.

Thanks for any help you can give me on this. This is crazy.
MoldChanges.accdb
0
Comment
Question by:G Scott
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 8
20 Comments
 
LVL 75
ID: 35133848
My guess .... because the Reference shown in the image below is Missing on the  other systems.

mx
Capture1.gif
0
 
LVL 75
ID: 35133861
Either you need to install the FMS product on the other systems, or that OCX (check with FMS) ... or uncheck that Reference when your app is put on other systems ...

mx
Capture1.gif
0
 
LVL 1

Author Comment

by:G Scott
ID: 35133908
Hey DatabaseMX, that's not the problem I am talking about. I don't get that reference error on any computer for some reason. Look at the attached version.

On the 'OnClose' event of the form 'frmMakeChange' I have commented out the code.:

 
'*****************************************************************
'Private Sub Form_Close()
'If Forms!frmMakeChange!Text2 = "Nothing Scheduled" Then
'Forms!frmMakeChange!Text2 = ""
'End If
'Forms!frmMoldChanges!btnSupEntry.SetFocus
'
''Call controlNameBack(Me.txtControlName)
'
'End Sub
'*****************************************************************

Open in new window


When I do this it works fine. I just don't get why this doesn't work on my laptop right now, but worked on my desktop before I left work.  MoldChangesWorking.accdb
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 58
ID: 35133962

  Make sure the app compiles.  

  If it does, how did you copy the DB to the laptop?  If on a wireless connection, try a hard cable or flash drive if you can.

  If it still fails, then run a repair on the Office 2007 install.

JimD.
0
 
LVL 75
ID: 35133975
Define "doesn't work" .... what error are you getting?

I can't really test because I don't have the FMS App ... so I   get loads of compile errors.

mx
0
 
LVL 1

Author Comment

by:G Scott
ID: 35134039
JimD - yep, it compiles. I had to comment out stuff I am not using, but it compiled.


mx - that FMS app was just something I was testing. I forgot to remove the form and references before uploading.

I don't get an error, the form 'frmMakeChange' just never opens. I have determined that it's the code in the OnClose event, but I can't figure out why it won't work, yet it does on my work PC.

Attached is the same DB with all FMS stuff removed. See if you can open it please.

 MoldChangesNoFMS.accdb
0
 
LVL 75
ID: 35134076
Opens on my A2010 system ....

mx
Capture1.gif
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 35134102
For kicks ... try the attached version ...

mx
MoldChangesNoFMS-MX01.zip
0
 
LVL 1

Author Comment

by:G Scott
ID: 35134120
Yours gives me a 'Recordset Not Updateable' when I click the 'Schedule Mold Change' button on the form.
0
 
LVL 75
ID: 35134132
All I did was Decompile the Compact & Repair the db ... I made no other changes.

mx
0
 
LVL 1

Author Comment

by:G Scott
ID: 35134144
This is where your's errors
0
 
LVL 75
ID: 35134159
And it still works on my system .... and if I click that button, I do not get that error.  I  added several Mold Changes (scheduled) ...

mx

0
 
LVL 1

Author Closing Comment

by:G Scott
ID: 35134171
Sorry mx id10t error on my part. I didn't notice I had it as Read Only. Sorry. Your solution worked perfectly! Thanks so much.
0
 
LVL 75
ID: 35134182
Not sure what my 'solution' was ...?

mx
0
 
LVL 1

Author Comment

by:G Scott
ID: 35134192
LOL. Well..the one you sent back opened up on 3 computers at my house that my previous version would not work on.
0
 
LVL 75
ID: 35134216
Then keep this Decompile procedure handy:

====


A **DeCompile** may help here ...

But first, if you have not already:
Open the VBA Editor and from the menu ...Tools>>References ....
If you see any listed as **Missing: <reference name>, including the asterisks and the word Missing, the
you need to fix that first.

Then, follow this procedure:

****
0) **Backup your MDB BEFORE running this procedure**
****
1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
Close the mdb after the Compact & Repair.
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Close the mdb.
6) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
       >>Debug>>Compile
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

7) Close the mdb
8) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an **example** of the command line syntax  (be SURE to adjust your path and file name accordingly) before executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:
Also, the double quotes are required.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\YourMdbNameHERE.mdb"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:

http://www.trigeminal.com/usenet/usenet004.asp?1033

mx
0
 
LVL 1

Author Comment

by:G Scott
ID: 35134248
Thanks for the help and the tip, mx; I appreciate it.
0
 
LVL 75
ID: 35134256
You are welcome.

Thank you for use Experts Exchange ...

mx
0
 
LVL 1

Author Comment

by:G Scott
ID: 35137423
Hey mx, not sure if you are still 'listening', but do you know what could have caused my issue to start with? Why that certain simple block of code would function on one PC and not another? I just want to make sure if it was something I did that I don't do it again.

Thanks.
0
 
LVL 75
ID: 35139935
The answer is ... it's hard to say. 'Hidden' corruption - in VBA code - happens, for many seemingly unknown reasons.  I've seen Decompile fix this kind of thing 100's of times.

mx
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question