Arguments for making a database compile free of errors

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Arguments for making a database compile free of errors

Post by Pat »

What are some arguments on compile free VBA code?

User avatar
HansV
Administrator
Posts: 78636
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Arguments for making a database compile free of errors

Post by HansV »

By "arguments", do you mean tips, suggestions?
Best wishes,
Hans

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Arguments for making a database compile free of errors

Post by JohnH »

By "arguments", do you mean tips, suggestions?
or do you mean Reasons for compiling the code.
Regards

John

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Arguments for making a database compile free of errors

Post by Pat »

Reasons for compiling the code.

User avatar
HansV
Administrator
Posts: 78636
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Arguments for making a database compile free of errors

Post by HansV »

The Visual Basic engine will automatically compile code the first time it's run; this means that a syntax/compile error in a procedure or function that is called only infrequently may not be discovered for a while - perhaps until your customer runs it.
Compiling VBA code does not guarantee that the code will work correctly - there can still be runtime errors and logic errors. But at least it ensures that there are no syntax errors in your code.
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12629
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Arguments for making a database compile free of errors

Post by StuartR »

The ONLY time that it makes sense not to compile code is if you have conditional compilation that depends on the version of VBA.
StuartR


Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Arguments for making a database compile free of errors

Post by Pat »

Thanks gents