Solved

Code Works on Mine but Not Others??

Posted on 1999-01-24
15
176 Views
Last Modified: 2011-10-03
I have a database that I have written in Access '97.  There is some simple code in it like to capitolize the first letter of a persons name, is the number they enter between these two number, etc.  Nothing fancy.  In developing the database it worked on my home computer and my work computer.  But, now the code works fine at home but on any other computer it won't work.  I have installed the SR-2 pack but the code problems were there before the installation.  I have tried repairing the database, compacting the database, everything!  I've even tried deleting the code and retyping it in another database that I created on that computer and it works!  What would cause the code not work on a database saved on my computer then ran on another?  I don't know what to do! Is there a problem between versions? Where do I begin and has anyone else had this happen to them?
0
Comment
Question by:myotis
  • 4
  • 4
  • 4
  • +3
15 Comments
 

Author Comment

by:myotis
Comment Utility
Edited text of question
0
 
LVL 7

Expert Comment

by:Dedushka
Comment Utility
Hi, myotis!
Try this: in Menu->Tools->References uncheck all references, close your database, open it again and reestablish references.

Let me know the result.
Dedushka
0
 
LVL 3

Expert Comment

by:chapie
Comment Utility
also, try ... well, there's a DLL file I forget which *G* *sorry*  I think it's something like OFF97.dll

I had some problems where the SP-1 upgrade where the DLL file was not updated, could be the same problem with SP2
0
 
LVL 1

Expert Comment

by:billinb
Comment Utility
Do you use a network at work?
0
 
LVL 12

Expert Comment

by:Trygve
Comment Utility
Dedushka has the right approach. The problem is related to differences in the version of some of the referenced files. This can come from different version of Access on the two computers, but also from having installed other programs that uses the same ActiveX controls etc. If you want the code to work on both computers you will have to make sure that they have the same set of files. Check out ComDlg32.ocx, ComCtl32.ocx, MSO97.dll, Dao350.dll, MSAcc8.OLB and Vba332.dll (these are some of the most common files to have referenced)
0
 
LVL 1

Expert Comment

by:ZenMaster
Comment Utility
Or instead of that you can edit the failing functions to have the prefix "VBA.".  Many times the VBA library doesn't link correctly, but if you tell the application which library to look at, it works fine.  It's also a good idea to do this because if your application is ever installed on another machine, it will work from the start instead of needing to be checked out.

Zen
0
 

Author Comment

by:myotis
Comment Utility
ZenMaster

Not to sound to lost but where do I put the prefix "VBA" ?  I do need the database to work on different machines.  The code fails no matter if it is in a form or report and I have several of each.

Dedushka,

I looked in the "Tools" menu for "References" I didn't see anything that said "References", I also tried under the "Options" in the Tools menu.  Could you be little more specific for a newbie?

billinb,

No, I am not on a network system.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 7

Expert Comment

by:Dedushka
Comment Utility
Hi, myotis!

"References" appears in Tools when you switch to module design view. Open some module in design view and you see "References in menu.

Good luck,
Dedushka
0
 
LVL 1

Expert Comment

by:ZenMaster
Comment Utility
In front of date conversions, string conversions, "C"-functions (CDate, CInt), etc.  (Type somewhere in your code "VBA." (no quotes) and the affected functions will list out...).  It's smarter to do this in your code because if the copy of Access that will run this (the workstation's copy) does not have the reference, it will have to be re-configured.

If you don't mind doing the re-configuring, open Access (your app), click Modules on the database window, then select Tools|References.  Scroll down the list to find "Visual Basic for Applications".  There may be several, choose the one that when highlighted says vbeext1.olb in the path box at the bottom.  Check it and say OK.  This will need to be done to EACH machine the application is on.

Zen
0
 
LVL 1

Expert Comment

by:ZenMaster
Comment Utility
Duh:  The module will have to be in design mode to get the proper references screen... (like Dedushka said)

Zen
0
 

Author Comment

by:myotis
Comment Utility
Dedushka & ZenMaster,

It worked!! After I went to the the design view of a new module it worked!!  My machine at work was missing a Fractual OCX file.  After I unchecked all of the files I could or Access would let me, I closed the database then reopen it and it seems to work!!  I didn't go back and recheck any of the references I has previously unchecked do I need to??  The program is only to run on about three machines so this should be an okay method for me!!

ZenMaster,
I didn't have any "C" - functions the code was in the event procedures of the text boxes, afterupdate - onclick etc.  An example of the code is:
'   Capitalize first letter
    If Not (IsNull(Me!FirstName)) Then
    Me!FirstName = CapitalizeFirst((Me!FirstName))
    End If
   
End Sub

Also, I didn't have a Visual Basci for Applications when highlighted had a path of vbeext1.olb.

Trygve,
I looked for the *.dll you had mentioned on the computer at work (not the one that the app would work on) my machine didn't have any of them.  I didn't look for a *.ocx
0
 
LVL 7

Expert Comment

by:Dedushka
Comment Utility
Congratulations, myotis!

Can i post my first comment as answer?

Dedushka
0
 

Author Comment

by:myotis
Comment Utility
Sure go ahead and post it. ZenMaster was also a big help and I really want to thank him/her.  ZenMaster's would be the ideal approach if I was to distribute it on alot of machines but with the small number that will run this app yours was the easiest method, THank You for your assisstance.  Was this something that happens alot with added *.ocx's?  It was the first time I've heard of it and none of the classes I've taken on Access even bother to talk about this issue.
0
 
LVL 7

Accepted Solution

by:
Dedushka earned 70 total points
Comment Utility
Hi, myotis!
Try this: in Menu->Tools->References uncheck all references, close your database, open it again and reestablish references.

Thank you for accepting my answer.

Sorry, myotis, i can't say something about your last question, because i use only MS Access standard controls.

Best regards,
Dedushka
0
 
LVL 1

Expert Comment

by:ZenMaster
Comment Utility
I get the next one, Dedushka!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

14 Experts available now in Live!

Get 1:1 Help Now