Skip to content
Access 2002/2003 VBA code examples

Introduction

This website is dedicated to collecting Access VBA code snippets. With the advent of faster and more reliable network infrastructure, and the possibility to not only use a file-based storage system, but Sharepoint and MS SQL Server as well, Access seems to have acquired a new lease on life. It certainly seems to be regaining popularity in the corporate world. Having done a fair bit of consulting for Access 2003 database development and deployments lately, here's my collection of handy code snippets that are a must-have to get serious work done with Access.

Contact me

Should you find errors, or have suggestions for improvements of anything you find on this web site, just drop me a line using the contact form. I am also available for Access or Drupal consulting assignments.

.htaccess magic - add www to your domain name url when missing, but leave subdomains untouched

This is a handy little snipped to include in you .htaccess file. It will add the 'www.' part to a domain name that was entered without it. It leaves explicit subdomains alone. So, if you would enter 'mysite.com' it would do a redirect to 'www.mysite.com', but if you entered 'ftp.mysite.com' it will not redirect to 'www.ftp.mysite.com'. Very useful if you run a site that sources settings from a url to do multi-site management, like drupal.

RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

AdaptiveThemes