# The Reason MS Access Forms and Reports are Limited to 22 Inches

With today's large monitors, many Access developers have bumped into the 22" maximum form width. But do you know why it's not 21" or 23"?

The maximum width of a form or report in Access is 22 inches.  That's also the maximum height of a section.

Which leads a curious guy like me to ask, "Why 22?"  Why not 21 or 23?  If it's just an arbitrary number, what difference does it make?

Well, it turns out it's not some arbitrary number.

## Twips, Bytes, and Binary Math, Oh My!

Before I explain where the seemingly arbitrary 22 inches comes from, we need a bit of context.

### What is a Twip?

A "twip" is 1/20 of a "point" (note that "twip" is an abbreviation for a "twentieth point").

A "point" is 1/72 of an inch.

Thus, a twip is 1/1440 of an inch (1/20 × 1/72 = 1/1440).

Or, as it is more commonly expressed, there are 1,440 twips per inch.

### What is a Byte?

A "byte" is 8 "bits."

A "bit" is a 1 or a 0, also known as a binary digit (note that "bit" is an abbreviation of "[bi]nary digi[t]").

### Binary Math

Computers store all data as bits (i.e., ones and zeroes), but modern computer hardware is optimized to perform calculations on–and store data in–groups of 8 bits at a time (i.e., bytes).  That's why numeric data types in most programming languages, including VBA, are stored in variables that are multiples of 8:

• `Byte`: an unsigned 8-bit number (0 - 255)
• `Integer`: a signed 16-bit number (-32,768 to 32,767)
• `Long`: a signed 32-bit number (-2,147,483,648 to 2,147,483,647)
• `LongLong`: a signed 64-bit number (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

## Why the Twip?

When deciding what unit to use for dimensions of forms and reports, early Access developers settled on the twip.

I think the reasoning is fairly obvious.  The twip had several advantages:

• It was a well-defined unit of measurement in the printing world.
• A single twip is so small there is no need to support fractional values.
• Using whole numbers as the underlying data type allowed the Access developers to use integer math when calculating and preparing layouts.  And integer math is more efficient and reliable than floating point math.

## Goldilocks and the Three Data Types

Once Access developers settled on the twip as their base unit of measurement, they needed to decide on a data type to store these values.

First, they tried Baby Bear's data type: an 8-bit number.  But that would have only allowed for a width of 255/1440 ≈ 0.177 inches.  Too small.

Then, they tried Papa Bear's data type: a 32-bit number.  That would have allowed for a width of 2,147,483,647/1440 ≈ 1.5 million inches.  Too big.

Finally, they tried Mama Bear's data type: a 16-bit number. That allowed for a width of  32,767/1440 ≈ 22.75 inches.  Juuuust right.

Until many years later, when large monitors with high resolution appeared and suddenly 22" didn't seem so big anymore...

All original code samples by Mike Wolfe are licensed under CC BY 4.0