Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Code Works on Mine but Not Others??

Posted on 1999-01-24
15
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 4
  • +3
15 Comments
 

Author Comment

by:myotis
ID: 1977649
Edited text of question
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1977650
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
ID: 1977651
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:billinb
ID: 1977652
Do you use a network at work?
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1977653
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
ID: 1977654
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
ID: 1977655
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
 
LVL 7

Expert Comment

by:Dedushka
ID: 1977656
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
ID: 1977657
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
ID: 1977658
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
ID: 1977659
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
ID: 1977660
Congratulations, myotis!

Can i post my first comment as answer?

Dedushka
0
 

Author Comment

by:myotis
ID: 1977661
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 280 total points
ID: 1977662
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
ID: 1977663
I get the next one, Dedushka!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

609 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