|
-
Dec 22nd, 2003, 10:33 AM
#1
Thread Starter
New Member
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!
-
Dec 22nd, 2003, 10:59 AM
#2
New Member
Check your references of the project by selecting Tools / References. It may be that a library link is missing.
Paul
-
Dec 23rd, 2003, 08:00 AM
#3
Lively Member
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
-
Dec 23rd, 2003, 03:40 PM
#4
Thread Starter
New Member
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!
-
Dec 23rd, 2003, 04:32 PM
#5
Thread Starter
New Member
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.
-
Dec 25th, 2003, 06:52 PM
#6
Hyperactive Member
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.
-
Dec 29th, 2003, 11:02 AM
#7
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|