Results 1 to 7 of 7

Thread: VBA program works on Access 2002 but not 2000

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    7

    Unhappy VBA program works on Access 2002 but not 2000

    Hi all,

    Is there any compatibility issue I should be aware of between Access 2002 and Access 2000?

    I have a VBA program that works fine on Access 2002, but on Access 2000, I always get run time error 5, incorrect function parameter or something like that.

    I'm new to VBA, so please give me suggestions on how to fix it?

    Thanks!

  2. #2
    New Member
    Join Date
    Sep 2002
    Location
    Fantasia, Castle Donnington 1993
    Posts
    8
    Check your references of the project by selecting Tools / References. It may be that a library link is missing.

    Paul

  3. #3
    Lively Member
    Join Date
    Jun 2003
    Posts
    114
    Not only libraries but there is new functionality in 2002 that is not in 2000 ... You can also try compiling your code to find all of those issues ... Ex: AddItem, RemoveItem methods

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    7
    Thanks for your help!

    I went to Tools, but I don't see an option called References... Could you give me more details on what to check?

    I did compile, and there was no error. I tried step through the program, and the run time error 5 (Invalid procedure call or argument) occurs in a select clause. More specifically, I have the following code:

    Select Case formMode
    Case PRINT_MODE
    ReprintForm
    Case GENERATE_MODE
    GenerateNewKey
    End Select

    And the run time error happens at Case PRINT_MODE. I made sure PRINT_MODE is defined, and formMode is defined too. I don't know why this is happening??? And it only happens on one machine.

    Also, it's not Access 2000 vs 2002 issue anymore, because I just had several 2000 machines with the program working perfectly fine. It's just this particular machine...

    Please help!
    Thanks!

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    7
    After running the program on the problem machine for several more times, I discovered a number of other places that had the same error. However, every time this error jumps out, it is at a "Case xxx" line. But not all "Case xxx" lines in my program causes the error, and I can't figure out what the difference is. Isn't this bizzard???!!!???

    Ok, I just realized its tools -> references for Visual Basic, not Access. Sorry, I'm not familiar with these stuff at all, just inherited this VBA program from someone else.

    I compared the checked references between machines. All the machines have 6 references selected, in the same order:

    Visual Basic for Applications
    Microsoft Access Object Library
    OLE Automation
    Microsoft ActiveX Data Object 2.1 Library
    vidtc3
    Microsoft Forms 2.0 Object Library

    The differences between machines I found are:
    - For "Microsoft Access object library", my machine has 10.0, but the problem machine has 9.0. However, on another machine that works, it had 9.0 too.
    - For "Microsoft Forms 2.0 Object Library", both my machine and problem machine uses system32\FM20.dll, but another machine that works has system\FM20.dll.
    - For vidtc3, my machine uses a file under visual studio, but the problem machine and another machine that works both use a different file.

    So this doesn't really tell me anything, there is no difference that can be isolated to the problem machine.

  6. #6
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346
    Could be that the Ole Database drivers on the problem machine are not up to date....
    If my post has been helpful, then please rate it accordingly...
    If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    7
    Thanks for the suggestion about ole database driver. Could you tell me exactly which files to look? Is it the file pointed by references (system32\stdole2.tlb)? Or are there some other files I need to check? I tried search online for OLE database driver, but not sure what I'm looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width