Module Name

Formatter for MS Project Export (WBS) - Updated

This is an updated version of prior code. With this, I have improved on several aspects:
Note, as always, use at your own risk, and make sure you review the code before using it.

Formatter for MS Project Export (WBS)

Although I am just starting to work more in MS Project, hence will likely develop code to enhance my productivity in a PM role, this is the first attempt.
Note, as always, use at your own risk, and make sure you review the code before using it.

SQL for Bad Column Names

As part of a project, I imported a user's worksheets into SQL Server, before realizing that the column names were terrible, and very non-standard. This scripts generates the SQL to correct 3 column name errors, using a space, a hyphen, and a tilde.

Structured Interview Template

Some basic elements useful for a structured interview for a developer or a project manager.

20 Cognitive Biases That Affect Your Decision-Making

We all make bad decisions sometimes, but have you ever wondered what mental obstacles can lead you astray? This infographic goes over 20 of the most common cognitive biases that can mess with your head when it’s decision time.
Gantt Charting Template.xlsx

Gantt Charting Template

A simple template for Gantt charting, with two examples:

Requirements Template

A general documents with areas to describe various facets of requirements analysis

Group Membership Check

Checks whether user is a member of a AD group

JavaScript API for Office (PNG)

The JavaScript API for Office includes objects, methods, properties, events, and enumerations that you can use in your apps for Office code.

The Microsoft.Office.WebExtension namespace (which by default is referenced using the alias Office in code) contains objects you can use to write script that interacts with content in Office documents, worksheets, presentations, mail items, and projects from your apps for Office.

Business Model Canvas

When founders are getting started with the Canvas, they tend to focus on the right side. And rightly so, Blank notes—that’s where product/market fit will unfold. But it’s the oft-neglected left side of the canvas that will tell you what your founding team should look like. On a successful Canvas, the two sides should mirror each other; the right is all about customers, and the left tells you what you need to reach them.

Filling in the Canvas is level one. But understanding the interplay of the boxes takes you to level two. That’s when your Canvas goes from a checklist to a strategy.

Finding the right co-founder is one of the most instrumental pieces of that strategy. Start by looking carefully at your Key Activities box. Of the nine modules on the Canvas, it most defines what you need to do to build your product and deliver it successfully to consumers. Then jump down to the next box labeled Key Resources, where you’ll list what’s required to execute those activities. Is there a gap between what you’re going to need and what you bring to the table yourself? That delta reveals the expertise you need to find in your co-founder.

Grouping Coalesce via XMLPath

Basic SQL showing how to coalesce and group simultaneously.

Database - Kill, Rename, and Drop

Shows better methods for killing processes that might be locking a Db rename or drop

Change Access Db Links

Changes TableDef and QueryDef objects with connection strings to a DSN-less connections.

Powershell File Rename

As the name says, the basic components of a folder's files renaming...

Align Secondary Axis (VB.NET)

The general algorithm used for aligning a chart's secondary axis with the primary axis:
  1. Get primary divisors
  2. Get upper and lower bounds of secondary
  3. Get larger ABS(max) or ABS(min)
  4. Multiply (max/min) divisor by numbers (1,2,5,10,20,25,30) to find the first multiplier larger than current
  5. Apply multiplier to major unit
  6. Apply min to min (min divisors x minor unit)
  7. Apply max to max (max divisors x major unit)

Align Secondary Axis (C#)

The general algorithm used for aligning a chart's secondary axis with the primary axis:
  1. Get primary divisors
  2. Get upper and lower bounds of secondary
  3. Get larger ABS(max) or ABS(min)
  4. Multiply (max/min) divisor by numbers (1,2,5,10,20,25,30) to find the first multiplier larger than current
  5. Apply multiplier to major unit
  6. Apply min to min (min divisors x minor unit)
  7. Apply max to max (max divisors x major unit)

Align Secondary Axis (VBA)

The general algorithm used for aligning the secondary axis with the primary axis:
  1. Get primary divisors
  2. Get upper and lower bounds of secondary
  3. Get larger ABS(max) or ABS(min)
  4. Multiply (max/min) divisor by numbers (1,2,5,10,20,25,30) to find the first multiplier larger than current
  5. Apply multiplier to major unit
  6. Apply min to min (min divisors x minor unit)
  7. Apply max to max (max divisors x major unit)

Adobe JavaScript Automation in VBA

Example VBA code for working with Adobe Acrobat in VBA, with some of the following features:


Kill Locked Processes

T-SQL to kill all locked processes

Find String in SP's

As the title says, simple SQL to find strings within stored procedures...

Get File Owner with PowerShell

A basic script to derive the owner of a file using, along with othe rinformation

SQL Execution Add-In for Excel (C# + Facade for VBA)

A C# library that simplifies some aspects of connecting to Db's and running SQL statements in a threaded manner. The C# code can also be exposed to Excel VBA, enabling it to simultaneously execute numerous SQL statements, something that cannot normally be done in VBA.

Get Number of Rows in SQL Objects

A stored procedure that returns the lines of code in various objects, in particular stored procedures or an entire database. Documentation is contained within the file.

Source:Third Abnormal Form

Pastel Blocks for Canvas (Javascript, HTML/PHP, CSS)

Four files, one for the js, one for the CSS, one for Modernizr, and one for the HTML/PHP, that work together to create dynamic, rectangle layouts in a canvas.

The original code was inflexible, with hard-coded height, width, and rectangle number, from which I changed to an object, and one that has a constructor with parameters.

I primarily work in VBA, C# and SQL, but some of my websites are PHP/HTML. I wanted to spruce it up a bit, and here is the site and the result of the javascript.

Workbook Close Event Capture

For anyone that has had to capture the WorkbookBeforeClose event and struggled with the imperfectness of the process, this is C# code that fires only if the workbook is completely closed.

Kudos to the developer; Wordpress entry is here.

Access Db Remote ShutDown

An Access DB that uses a hidden form to shutdown database FE. to use this code:

Create Named Range (Excel / C#)

When creating pivot tables and charts, Excel's default is to base it on a fixed range, not on one that expands. This code generates a named range that is dynamically expanding in both the row and column dimensions, using the Offset function, useful in pivot tables and charts where the data will be updated and will likely expand beyond the original size.

Excel Constants for Access

A module of global constants as long values with descriptive name for use in late-binding Excel, either from Access, or internally.

Working with CustomXmlPart (C#)

This C# code shows the basics of working with CustomXmlParts of the Office 2007 and greater environment. It is a way to store complex information within workbooks. In this example, I create a type, and the create XML to stores the type, and then either set, or retrieve the XML.

Working with CustomXmlPart (VBA)

This code shows the basics of working with CustomXmlPart of the Office 2007 and greater environment. It is a way to store complex information within workbooks. In this example, I create a type, and the create XML to stores the type, and then either set, or retrieve the XML.

XLA for Operations Management Statistical Functions

An XLA that adds additional Operations Management statistical functions to Excel: Built several years ago while I was an MBA student, it might lack some controls, i.e., validation.

Worksheet Wrapper Classes

This is an idea I developed to avoid using arrays while refactoring spaghetti code. The user had used numerous arrays across many sheets with many columns, and for some refactored features I decided to create a parameter class for the rows of select sheets, and then a class that would hold a collection of parameter classes, providing type ahead and methods to get values, as well as provide basic properties like Count and Item.

Note: Requires an additional helper function contained in System_CommonArrayFunctions

Array and Collection functions (VBA)

The collections functions used worksheets like object collections, providing persistence. Some similar code used classes to wrap worksheet information to provide type-ahead, instead of using arrays via numbers.

Collection Functions Array Functions

.Net Programming Standards and Conventions

An Excel file displaying .NET programming standards and conventions

Composite Pattern

A implementation of the composite pattern similar to a class that would be used for constructing a binary search tree. Better, more detailed implementations are known as red-black or AVL trees.

Salient Characteristic(s)

Builder Pattern

Below is a fairly straightforward 'fill-in-the-blanks' example of a Builder design pattern:

Salient Characteristic(s)

Facade Pattern (VBA to .NET)

This is code possible through .NET, in that it bridges across to COM for automation in VBA. This concept can be extended to work for many other COM-based applications. This code allows the add-in to expose internal .NET-coded procedures to Excel COM, extending the use of the .NET code.

Salient Characteristic(s)

Facade Pattern (Example)

This is derived from actual code of mine, and elements of this sample combine the Facade pattern with the Publisher (Observer) pattern. The primary class, based on the ISubscriber interface, is fairly complicated to use, requiring delegates, threading, and asynchronous callbacks. The facade, based on ISubscriberFacade, encapsulates all the methods required to work with the Windows Communication Foundation (WCF) service , handling threading, delegate creation, and asynchronous callbacks internally, so that that the clients only need to create the object. I wrote the encapsulating client to ease the adoption of the WCF service for legacy clients, seeing that the code complexity was likely a hurdle.

Salient Characteristic(s)

Multiton Pattern (Example)

A fairly simple example of the multiton pattern, with a private constructor, and a tracker for created objects, the name being an integer identifier.

Salient Chacteristic(s)

Prototype Pattern (Example)

Whereas ICloneable will be used to return a shallow copy, the data object's attribute Serializable enables creation of a deep copy of the data object, instead of a reference:

Salient Chacteristic(s)

Lazy Initialization Pattern (Example)

A fairly straightforward 'fill-in-the-blanks' example of a Lazy Initialization design pattern, except that this uses an enumeration for the type - I hate passing strings, so easy to screw up - as well as a struct for the type that is lazily initialized.

Factory Method Pattern (Example)

Following is an example of the Factory Method. In this case, a method call sets and returns the type. Also, pardon the values set as field, rather than as properties, but this is a simple example, rather than a full implementation.

Salient Point(s)

Bridge or Adapter Pattern (Example)

A bare-bones, generic implementation of the bridge pattern, using inheritance, polymorphism, and abstraction.

Salient Characteristic(s)

Abstract Factory Pattern (Example)

My work requires working with Windows Communication Foundation (WCF) services daily, and I typically have two (2) types of clients, either Excel, which is the largest part of my user base, or external applications, usually server-based. This example uses the idea of two (2) client types, each requiring a different host/port combination, which the abstract factory pattern will return.

Salient Characteristic(s)

Singleton Pattern (Example)

The Singleton design pattern seems generally frowned upon, except for use in logging classes. Below are several variants of the Singleton design pattern, of which, only the thread-safe version merits attention:

Salient Characteristic(s)

Power Code - Handle Sleep & Suspension

Excel C# code to reload an Excel add-in, although this should work for any office product, upon waking from suspend on Windows 7

Send Excel Range as Image (VBA)

VBA code to send a selected Excel range as an image via Outlook email

Excel Version Check (VBA)

VBA code for returning the Excel application version, updated to include Excel 2010

Dispatching Observable Collection

Working with WPF and ObservableCollection using threads, one will run into the problem whereby you cannot update an ObservableCollection from outside the owning thread; Delegates and Invoke will not work. A solution is to inherit and expand the class, as is done in this example on michIG's Blog

The attached file contains the original code in C#, as well as code converted to VB.NET.

Various Number Functions (F#)

A collection of basic mathematical functions written in F# as part of my learning via Project Euler. This module has functions for creating arrays or calculating values for the following:

Basic Statistical Functions (F#)

A very basic F# class for performaing standard deviation and variance calculations.

Competency Matrix for VBA

A developer, Sijin Joseph, reachable @, has an online Programmer Competency Matrix, which I have taken and converted to Excel.

Project Euler Language Stats (Excel 2003/2007)

An alternative ranking to Project Euler's stats (Excel 2003/2007), creating a sortable lists from language rankings.

Get Pivot Chart Series Source

A sample VBA method that extracts and selects the source data range pivot for pivot charts.

C# Add-in for VBA via COM

A C# project that can be used to expose methods to VBA via COM automation:

The project includes multiple methods:

C-Sharp form, printing and formatting options C-Sharp OLAP connection-related methods C-Sharp refresh pivot methods The project implements one form for printing, but otherwise has no UI. Included is a text file showing how to access and execute the methods via VBA.

This is an update C# add-in that exposes static methods using Excel-dna.

Copy Pivot and Charts, Modify Source (VBA)

In Excel 2007, it is not directly possible to change the data source for a pivot chart, but this code that shows how to copy a worksheet while repointing the pivot charts to the copied pivot table, rather than the having them reference the source pivot table.

Thread Array for Command Pattern

A thread array, that provides several ways to execute a collection of threaded objects
Typical properties/parameters

Summation Examples (VBA)

I was asked by a student to assist writing some VBA code. The assignment, as per the student: There are 2 ways to solve this, the usual iterative way and a mathematical away. The mathematical way is smarter.
In the first: The second is more like an equation: Included in the ZIP file is both the code as text file, as well as an Excel 2007 file that uses the functions in equations accessible to the user.

SMTP Addreses from Outlook (C#)

This is C# WinForm code that demonstrates using Outlook (requires a third-party COM product called Redemption) to get at the SMTP addresses from the outlook address book. It takes about 60 minutes to output a file, also attached, of ~160k users and their SMTP address, but it shows the basics of the process. This is not likely appropriate for server use. Below is the code, but an easier solution might simply be for the code sending the email to iterate through the list and send an email to each person, and record failure for any particular address

VSTO (C#) COM Memory Cleanup

Two examples (one works on the workbook's pivot caches, the other is on a single instance of a pivot) of working through Excel and cleanup

Technical Evaluation Matrix for VBA

An Excel 2007 worksheet to facilitate in technical interviews of Excel/Acces VBA candidates.

COM Memory Cleanup for Office Interop (C#)

Helper code for cleanining up memory when working with Excel in .NET (COM Object)

Design Pattern List (Updated)

An updated list of design patterns covering ideas laid out by the GoF, Code Complete, Pattern-Oriented Software Architecture, and Patterns of Enterprise Application Architecture.

Naming Conventions for .NET

Naming conventions for the .NET platform, a cleaner version of a previous file.

CellSet, DataTable, Recordset Conversion (C#)

This C# code that generates a cellset from MDX, transforms it into a datatable, tranforms that into an ADODB recordset, and then creates a pivotcache/pivottable from the recordset. It gets around the inability of Excel 2003/2007 to create pivot tables directly from MDX.

Working with Document Properties (VBA)

Code module for working with document properties. Original code is from Pearson's website, with some modifications by myself.

Generic SQL Database Interface (VBA)

Basic code for executing stored procedures, or SQL, via a connection object with VBA.

Inserting Hyperlinks (C#)

Code for inserting hyperlinks. This was initially designed to work from a ribbon, which finds the selected cell(s) and passes that to the methods to insert hyperlinks.

Rename File System Objects (VBA)

Uses file system objects to rename files by moving them.

Delete Bad Ranges (Excel VBA)

Iterates through the active workbook and deletes all invalid named ranges, e.g. #REF.

Change Pivot Table Connections (VBA)

An excel class that processes a collection of Excel files to change pivot table connection strings, as well as other parameters.

Access VBA Modules from forms, that show how to retrieve domain-related information. These are provided as examples, since you will need to decouple the code from the underlying tables and related forms to use them.

An example of a stored procedure using the newer TryCatch block with transactions. Much cleaner and easier than the older style using trapped errors.

An example of web service code to return log data.

A 'naive' implementation of a logging class for ASP.NET and SQL Server. By naive, I mean that I wrote it when first starting out, so the code likely violates some basic design tenets.

VB.NET class for doing generic data reads, encapsulating redundant connection.reader code.

An example of how join MDX and SQL results using relations in C#

VBA for iteration an OLAP cube's metadata and values.

Design Patterns

Sample code to perform a compact copy of an Access DB.

A simple class to do logging

Example of a class module used to interface between Access or Excel application and SQL Server.

An SQL function to calculate business days between dates, excluding holidays

Access class module, although should work in Excel with minor modification, that automates zipping files, with parameters for the following:

Properties Methods

An Access DB that queries the domain for object, e.g., user ID's. Requires that you modify code to specify a domain The code can be run from the supplied form or directly, and truncates and appends to the supplied table. Please note, this was last edited in Access 2007, and if you are using an earlier version, you will need to correct broken references.

A function that sends (no prompt) a Notes e-mail, based on passed values for subject, recipient, body, and attachment.

A class that encapasultes an import process, although somewhat tied to specific process, easy modifiable to decouple and/or modify it as needed. In general, the process requires a source data file, an import type specified, staging and master tables, a report date field, a level1 field (a coupled requirement that can be removed), and a cleanup bit for dirty imports that can be turnd on or off.

Changes the DB referenced in data refreshes, provided that all the linked queries are the same DB.

Listing of ASCII character representation by number, as well as appearance if formatted as W*Dings in Excel.

Access code to backup all modules, forms, and queries, as well as create tables of table features; code checks for tables' existence and creates if necessary. Dynamically creates backup folder in the folder of the Access MDB.

A very simple module to return the screen resolution of the current desktop.

Form Resizer For Microsoft Access (By Jamie's Software)
The Form Resizer is a Microsoft Access MDB (Microsoft Database) that allows you to install a module in your own Access MDBs that can resize your program's forms to fit the current screen resolution. It is intended for Access developers with basic Visual Basic for Applications (VBA) coding knowledge. Works with Access 97, 2000, 2002 and 2003.

A simple class function to provide weekday calculation, native to Excel, in Access.

in SMS, a simple graphical interface for installations. Once compiled, one only need modify the INI file with application information, path information, and EXE name. The EXE and INI should be located in the same directory.

A module which replaces the MkDir function, such that it verifies and creates an entire path; MkDir only creates a new directory on an existing path. Please note that this module was create by Pearson Consulting for Excel, and I simply modified it to work in Access.

Excel VBA Workday Function

Function that can be used to calculate target dates, taking into account a date and hours/minutes of work, compensating for weekends, but not holidays: It populates most of the Original Target Date column, I, and is built into the spreadsheet. Also, It might be inaccurate over longer time intervals, but it works in this context.

Excel Constants as Global Vairables for Late-Binding

The entire list of Excel 2003 constants and values, useful when late-binding Excel in Access automation.
Analyst Toolkit.xla

An XLA that exhibits a floating toolbar with numerous built-in functions, including numeric formatting, special print formatting via screen selections, and a drop-down menu with parsing options.

Verifies if a table exists; returns boolean for success; useful when users can delete files, preventing a process from executing if a table does not exist.

Verifies if a query exists; returns boolean for success; useful when users can delete files, preventing a process from executing if a query does not exist.

From Access, manipulates an Excel workbook - it defaults to the first tab but code can be improved to specify a worksheet object or a specific tab - sorting a worksheet object on a passed field and a sort order.

From Access, finds a text value in Excel and returns its range (cell). The function is passed a worksheet object, a text value to find, and an optional row to search. If no row is specified, it searches the used range of the specified worksheet.

Verifies that columns in a table exist, created to verify column heading on imported Excel spreadsheets. The function receives a table name as string, and comma-delimited column names as string, verifies existence of table, parses the column string into array, and then tests for each column, returning TRUE if all exist, else False.

Procedures (2) to compare strings in Access, either by stripping all non-numeric characters, or by stripping all non-alpha characters. Useful in queries when having to compare strings that are functionally the same, but typed differently, e.g., with hyphens or commas.

Primarily a timer, and paired with other code can be used to send reports, shut down a database, and/or perform other system activities.

Access MDB to backup stored procedures. Code checks for table's existence and creates if necessary. Requires modification of module level variables to fit your environment. Creates both a date-stamped folder of individual SQL files, as well as an export to a single HTML document.

Converts strings to tables, necessary with long strings that need to be incorporated into dynamic SQL, and this circumvents the 128-character limit.

Stored procedure to create crosstabs; extensive documentation on parameters inside file.

Access code to backup stored procedures. Code checks for table's existence and creates if necessary. Requires modification of module level variables to fit your environment.

Sums to each column of a Excel range (UsedRange), but requires passed variables for the starting column and starting row.

An AutoSave feature for Excel, done entirely in code. Includes a procedure for adding a dropdown menu to a toolbar.

Excel Chart DrillDown: Captures Shift+Click, enabling drill down into a pivot chart. It has three (3) components, one a class module, one contains code for ThisWorkbook, and one is a regular module that sets and resets the event to the current chart. I've trimmed out anything specific to the client, but you still to debug and customize it to fit your needs.

In conjunction with a backend database and stored procedure, modularizes logging in Excel workbook.

Executes a recordset and returns values to array. Internally, the array is transposed, then transposed again, to return the array in its expected recordset-like structure.

Worksheet event forces naming of new sheet or chart. Used with global variable, such that if the global variable is "", the procedure executes, otherwise it skips.

Replace illegal characters: Function accepts string and replacement value; replaces string with value for a set of illegal characters, i.e.,[,],\,/,:, ', ?, and *.

Excel VBA Example: Formatting Ranges

Formats a range: supply a range and it formats to the end of the used range, meaning converts text to values and justifying.

VBA Functions to Validate Types

Multiple functions that validate data types.

Export Access Tables for Excel (VBA)

Procedure to export all data tables as Excel workbooks. includes a procedure to format each workbook. Note, that the internal path is fixed and will need to be modified to suit your needs, either as a new path, or as a recipient of a more dynamic, form value.

Creating Pivot Tables (Excel, VBA)

Two example procedures for creating pivot tables in code. One simply create a pivot table with an internally-specified worksheet, while the other works as a function, accepting various workbook-related objects, and returning a boolean to indicate success or failure.

Excel (pre-2007) Addin for Euro to US Conversion

An XLA for Euro-US conversion. Built several years ago, the code could be improved, but includes a menu, command bar, internet data retrieval, and special functions to convert currencies in ranges/cells.

Export VBA Modules as Text

Exports Excel modules and forms as text to a hard-coded subdirectory. In conjunction with a form, the path can be dynamic, and provide additional source code backup.

Please note that you will need to modify macro security to enable "Trust access to the Visual Basic project" via the menu (Tools | Macro | Security... | Trust Sources).

Fix Numbers Stored as Text (Excel, VBA)

Fixes numbers stored as text, a common problem with Access exports to Excel, by copying the value back into the cell, avoiding formulae.

File Exists Function (VBA)

Simple function to test for a file's existence.

Excel Format and Printing Functions (VBA)

Used as a function, receives an optional print orientation, and formats a worksheet for printing; provides a consistency of appearance, with coloring, header and footer. Returns a boolean.

Excel Formatting (VBA)

A collection of procedures to format numbers; previously included in an XLA to reduce effort in using functions repeatedly.

Text Parsing (Excel VBA)

A collection of procedures to parse text; previously included in an XLA to reduce effort in using functions repeatedly.

ADO SQL Request

Access module using ADO to bring data back from server (Sybase, but modifiable to any major server brand) to populate a predefined table.

Get User Id via Windows API (VBA)

Basic module using Windows API to get the username (UserID or login ID) of the currently logged in user.

Query Active Directory (AD) for User Information

A VBScript that requests UserID information from a domain, which you will need to specify. Please note, this file is stored as a ZIP file.

Export Access Tables for PortgreSQL

Exports Access data into form that can be inserted in PostgreSQL database. Not my own code, but provided by third party.

Transpose Array (VBA)

MS VBA code to transpose an array, presumably used in conjunction with GetRows.

Execute and Log SQL Requests (VBA)

Instead of executing SQL literals in code, a function that receives an SQL string, the executes and logs it. Includes a module to deal with strings containing quotes.

Verify Email and URL Strings (VBA)

Two modules to verify strings, e-mail and URL. Works in either Excel or Access.

Execute SQL and Log (VBA)

Instead of executing SQL literals in code, a function that receives an SQL string, the executes and logs it. Includes a module to deal with strings containing quotes.

Export Table to Excel (Access VBA)

Exports all internal tables as Excel spreadsheets. Has hard-coded internal output path, which can be modified, as well as recoded to be directed via form.

Outlook EMail via VBA

Sends e-Mail via Outlook. Written as function, so is passed recipient string and memo body. Can be modified to suit.

Test for Form State (Open)

Function to test for the existence of a form. Useful to test if a form is open, so as to close it.

Late-bound Outlook E-Mail from Excel

VBA code to create late-bound Outlook E-Mail from Excel, with abilities for To, CC, BCC, subject, memo, and attachments.

UserID using Windows API

Gets the UserID from the Windows using an API call - it is recommended that none of the syntax is modified - as well as a function to evaluate the returned value.

Building an Excel Command Bar (pre-2007)

Displays the basics of building an Excel command bar, as well as how to delete it. This can be part of a larger XLA or XLS, with workbook specific functions.

Export Recordsets to Excel

Three (3) procedures to export recordsets to Excel, including two (2) procedures that format Excel, either when called from within other procedures, or alone from a form.

Excel VBA Constants

Enumerates VBA constants, useful when Excel is late-bound in Access, or when simply late-binding Excel VBA code, since many methods and properties are not readily available.

Export Access information to tables and text files

Exports Access components to tables, in the case of queries and tables, or subdirectories, for modules, to a hard-coded subdirectory. Also includes function to enumerate Access data type values as strings. In conjunction with a form, the path can be dynamic, and provide additional source code backup.

Code-based ALTER TABLE statement

Pass it the table, the field, and the type, and it executes an SQL statement to modify the field's table.