in

MSMVPS.COM

The Ultimate Destination for Blogs by Current and Former Microsoft Most Valuable Professionals.

Tonys Microsoft Access Blog

Anything I find interesting about Access that isn't large enough to put on its own page as well as any updates to my website or the Auto FE Updater. Also links to blog postings and articles I feel would be of interest to developers.

What I always keep forgetting about IsMissing

like using IsMissing when appropriate on the argument list of a subroutine or function.  But I keep forgetting that I have to then declare that variable as a variant.

Good: Sub SendQuerytoExcel(strQuery As String, Optional strXLSName As Variant, Optional strSheetName As Variant)

Bad: Sub SendQuerytoExcel(strQuery As String, Optional strXLSName As String, Optional strSheetName As String)

If you forget then the string comes in as a zero length string, that is "".   And, of course, it's not missing.  Yes, yes, I know the help tells you this. It's just that i keep forgetting.

And it sure would be nice if the Microsoft Access team could put this in the VBA compiler.  After all if a field is optional it must be variant to be of any use.

My apologies if this is a duplicate as the blog server lost this entry so I had to repost it.

Published Aug 04 2007, 02:15 PM by Tony
Filed under: , ,

Comments

 

Jamie Collins said:

"it sure would be nice if the Microsoft Access team could put this in the VBA compiler"

AFAIK the Microsoft Access team do not 'own' the VBA compiler.

Jamie.

--

August 10, 2007 10:14 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
Copyright © is the original authors. Blog site is an independent site not sponsored by Microsoft. The Yoda blog server and the Brianna SQL server would like to thank www.ownwebnow.com and www.exchangedefender.com. They wouldn't be here and broadcasting without the generosity of Vlad Mazek and his companies.
Powered by Community Server (Commercial Edition), by Telligent Systems