Results 1 to 7 of 7
  1. #1
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402

    option explicit issue acc2003 to acc2010

    I have a db in access 2003 it needs to run on an access 2010 machine, all this is ok now and it works fine, but i had to remove the line option explicit, even though i had defined all variables.


    My question is why is this so.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why did you have to remove? What error message were you getting? Did you have to remove from every module?

    This should not have been necessary.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Yeah, not necessary at all if you are defining all of your types. Error messages would help.

  4. #4
    drexasaurus's Avatar
    drexasaurus is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Santa Ana, CA
    Posts
    60
    This is probably not the issue, but if you know that everything is as it should be etc, etc. and you tried everything else, sometimes decompiling the code will help. You have to do it from the command line but if code is behaving erratically, sometimes this is the only thing that will fix it for me. Make sure you back-up first!

    On the command line it will look something like this "<path to MSACCESS.exe where MS office is insalled>" /decompile "<path to file where access database is>"
    Replace stuff in brackets with actual paths of course. Leave in the quotes.

    Extra hint: If this is going to be used by multiple people with different operating systems, decompile on the oldest operating system.
    Last edited by drexasaurus; 02-13-2014 at 05:40 PM. Reason: Thought to remind about quotes right after I pressed save

  5. #5
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    I agree with most of the others, I would go as far as to say you're definitely mistaken. If the only change you had to make to enable the project to compile was by removing Option Explicit, then by definition, that means: (for sure) - that you did not have a variable properly typed. Directly or indirectly. There is no other reason.

    There may be other things that appear to be reasons

    And you should NOT remove option explicit. You should leave it there and figure out what the problem is, rather than disguising the problem by just removing the very item that is telling you you have a problem. Removing option explicit is like putting a patch over your eye so that you no longer see a problem...rather than fixing the problem..

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by trevor40 View Post

    ...i had to remove the line option explicit, even though i had defined all variables...
    Did you have to do this for one Form, or all Forms? Assuming that your statement above, in red, is correct, I can only think that if it's one Form, that Form is corrupted. If it's all Forms, I'd guess that the Database, itself, was corrupted.

    Easiest first step would be to Import everything into a new, blank database.

    As has been said, it really is advisable to use Option Explicit.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Quote Originally Posted by Missinglinq View Post
    Did you have to do this for one Form, or all Forms? Assuming that your statement above, in red, is correct, I can only think that if it's one Form, that Form is corrupted. If it's all Forms, I'd guess that the Database, itself, was corrupted.

    Easiest first step would be to Import everything into a new, blank database.

    As has been said, it really is advisable to use Option Explicit.

    Linq ;0)>

    Respectfully would disagree with that. The next step is not assuming corruption, it's Compiling the database and reporting to those who are helping, at what point the compiler objects. Provide the line of code that offends, and the entire Sub/Function wherein it's contained.

    And, let us know what the error actually was, or what made you think you had to remove option explicit. Learning how to compile and how to react to compiler errors should come first, before assuming anything is corrupted which I doubt it is..

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Explicit Relationships and Implicit Relationships
    By Dazza666 in forum Database Design
    Replies: 2
    Last Post: 07-17-2013, 02:11 AM
  2. Acc2010 Inventory Template
    By orange in forum Access
    Replies: 4
    Last Post: 12-05-2012, 08:21 PM
  3. Replies: 2
    Last Post: 12-01-2012, 07:10 AM
  4. Implicit / explicit relationships in Access
    By starson79 in forum Access
    Replies: 4
    Last Post: 01-26-2011, 08:50 AM
  5. no option to import xls file or option all files
    By captgnvr in forum Import/Export Data
    Replies: 3
    Last Post: 09-22-2009, 10:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums