Solved

VBA not working on other computers - works on mine.

Posted on 2011-03-14
20
308 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
  • 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
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.

 
LVL 57
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 - Access MVP) 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now