?
Solved

Code Works on Mine but Not Others??

Posted on 1999-01-24
15
Medium Priority
?
222 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

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.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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