• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

VBA not working on other computers - works on mine.

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
G Scott
Asked:
G Scott
  • 11
  • 8
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
My guess .... because the Reference shown in the image below is Missing on the  other systems.

mx
Capture1.gif
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
G ScottAuthor Commented:
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
Industry Leaders: 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!

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

  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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
G ScottAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Opens on my A2010 system ....

mx
Capture1.gif
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
For kicks ... try the attached version ...

mx
MoldChangesNoFMS-MX01.zip
0
 
G ScottAuthor Commented:
Yours gives me a 'Recordset Not Updateable' when I click the 'Schedule Mold Change' button on the form.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
All I did was Decompile the Compact & Repair the db ... I made no other changes.

mx
0
 
G ScottAuthor Commented:
This is where your's errors
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
G ScottAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Not sure what my 'solution' was ...?

mx
0
 
G ScottAuthor Commented:
LOL. Well..the one you sent back opened up on 3 computers at my house that my previous version would not work on.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
G ScottAuthor Commented:
Thanks for the help and the tip, mx; I appreciate it.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome.

Thank you for use Experts Exchange ...

mx
0
 
G ScottAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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!

  • 11
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now