Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA not working on other computers - works on mine.

Posted on 2011-03-14
20
Medium Priority
?
318 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

963 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