Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Access Modules (VBA Coding) FAQ

Error Resolution

Illogical "Query too complex" & "Bad DLL calling convention" errors by BoulderRidge
Posted: 7 Jul 04

Query too complex
Bad DLL calling convention - error 49

If you receive either or both of these errors while running VBA code and the error message does not seem to apply to your situation, here's another possible resolution.

Both of the above errors can legitimately be caused by the error description but I had a custom VBA function which was working for weeks and then after some edits started crashing with the above two errors. The first error showed up in my error handler message box but if I ran the offending function call manually I received the second error instead. Neither message seemed relevant to my code. After several attempts to resolve it by replacing the queries used in the function and doing the repair/compact routine, I was stuck. The function itself would complete correctly without going into its error handling routine but when control returned to the calling procedure it immediately errored.

What worked was that I exported a copy of the module as a backup and then copied and pasted the offending function into Word. Then I created a new module in the database and pasted lines of code from Word back into the new module, skipping blank lines and extra comments (ie. not a wholesale copy and paste, but several 1-3 line copies and pastes.) I saved the new module with the "new" function and then deleted just that function from the original module. Saved everything and magically now it works!

Wouldn't be too big a stretch to imagine this could work with other illogical error messages too... Anyone know what could get into a piece of code that would make it go wacky like that?

Back to Microsoft: Access Modules (VBA Coding) FAQ Index
Back to Microsoft: Access Modules (VBA Coding) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close