Solved

VBA not working on other computers - works on mine.

Posted on 2011-03-14
20
306 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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

13 Experts available now in Live!

Get 1:1 Help Now