Computer and Software Support


Format 

 

Microsoft Access

There is several settings you can set for a field in the database table. To see the list of options available, click here.

To access Field size, do the following

  1. Open Microsoft Access

  2. On the left hand side, double-click the database (in this example it is Deaths, yours will be different)

   
  1. Click Design View (click hyperlink for instructions)

  2. Click the filed on top that you want to modify

   
  1. Click the right column on Format

   

 

Returns a Variant (String) containing an expression formatted according to instructions contained in a format expression.

See some examples

Syntax

Format( expression [, format ] [, firstdayofweek ] [, firstweekofyear ] )

The Format function syntax has these arguments:

Argument

Description

expression

Required. Any valid expression.

format

Optional. A valid named or user-defined format expression.

firstdayofweek

Optional. A constant that specifies the first day of the week.

firstweekofyear

Optional. A constant that specifies the first week of the year.

Settings

The formatargument can use a variety of settings, depending on the data type of the expression argument. Consult the articles listed in the following table for more information about valid format expressions.

For expressions that use this data type...

See the article

Any type

Format Property

Date/time

Format Property - Date/Time Data Type

Numeric

Format Property - Number and Currency Data Types

Text and memo

Format Property - Text and Memo Data Types

Yes/No

Format Property - Yes/No Data Type


The firstdayofweek argument has these settings:

Constant

Value

Description

vbUseSystem

0

Use NLS API setting.

VbSunday

1

Sunday (default)

vbMonday

2

Monday

vbTuesday

3

Tuesday

vbWednesday

4

Wednesday

vbThursday

5

Thursday

vbFriday

6

Friday

vbSaturday

7

Saturday


The firstweekofyear argument has these settings:

Constant

Value

Description

vbUseSystem

0

Use NLS API setting.

vbFirstJan1

1

Start with week in which January 1 occurs (default).

vbFirstFourDays

2

Start with the first week that has at least four days in the year.

vbFirstFullWeek

3

Start with the first full week of the year.


Remarks

To Format

Do This

Numbers

Use predefined named numeric formats or create user-defined numeric formats.

Dates and times

Use predefined named date/time formats or create user-defined date/time formats.

Date and time serial numbers

Use date and time formats or numeric formats.

Strings

Create your own user-defined string formats.


If you try to format a number without specifying format, Format provides functionality similar to the Str function, although it is internationally aware. However, positive numbers formatted as strings using Format don’t include a leading space reserved for the sign of the value; those converted using Str retain the leading space.

If you are formatting a non-localized numeric string, you should use a user-defined numeric format to ensure that you get the look you want.

Note: If the Calendar property setting is Gregorian and format specifies date formatting, the supplied expression must be Gregorian. If the Visual Basic Calendar property setting is Hijri, the supplied expression must be Hijri.

If the calendar is Gregorian, the meaning of format expression symbols is unchanged. If the calendar is Hijri, all date format symbols (for example, dddd, mmmm, yyyy) have the same meaning but apply to the Hijri calendar. Format symbols remain in English; symbols that result in text display (for example, AM and PM) display the string (English or Arabic) associated with that symbol. The range of certain symbols changes when the calendar is Hijri.

Symbol

Range

d

1-30

dd

1-30

ww

1-51

mmm

Displays full month names (Hijri month names have no abbreviations).

y

1-355

yyyy

100-9666