Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.

Similar presentations


Presentation on theme: "INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014."— Presentation transcript:

1 INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014

2 SETTING FIELD PROPERTIES

3 FIELD SIZE Enter a value from 1 to 255. Text fields can range from 1 to 255 characters. For larger text fields, use the Memo data type. Byte — Use for integers that range from 0 to 255. Storage requirement is 1 byte. Integer — Use for integers that range from -32,768 to 32,767. Storage requirement is 2 bytes. Long Integer — Use for integers that range from -2,147,483,648 to 2,147,483,647. Storage requirement is 4 bytes. Single Use for numeric floating point values that range from -3.4 x 10 38 to 3.4 x 10 38 and up to seven significant digits. Storage requirement is 4 bytes. Double Use for numeric floating point values that range from -1.797 x 10 308 to 1.797 x 10 308 and up to fifteen significant digits. Storage requirement is 8 bytes. Replication ID Use for storing a globally unique identifier required for replication. Storage requirement is 16 bytes. Note that replication is not supported using the.accdb file format. Decimal Use for numeric values that range from -9.999... x 10 27 to 9.999... x 10 27. Storage requirement is 12 bytes.

4 FORMAT Determines the way that the field appears when it is displayed or printed in datasheets or in forms or reports that are bound to the field.

5 INPUT MASK Displays editing characters to guide data entry.

6 CAPTION The label text that is displayed for this field by default in forms, reports, and queries. If this property is empty, the name of the field is used. Any text string is allowed.

7 DEFAULT VALUE Automatically assigns the specified value to this field when a new record is added.

8 VALIDATION RULE Supplies an expression that must be true whenever you add or change the value in this field.

9 VALIDATION TEXT Enter a message to display when a value that is entered violates the expression in the Validation Rule property.

10 REQUIRED Requires that data be entered in the field.

11 SMART TAGS Attaches a smart tag to the field.

12 TEXT ALIGN Specifies the default alignment of text within a control.

13 UNICODE COMPRESSION Compresses text that is stored in this field when less than 4,096 characters are stored.

14 ALLOW ZERO LENGTH Allows entry (by setting to Yes) of a zero-length string ("") in a Hyperlink, Text, or Memo field.

15 APPEND ONLY Determines whether to track field value changes.

16 INDEXED Specifies whether the field has an index.

17 NEW VALUES Determines whether an AutoNumber field increments with each new value or uses random numbers.

18 DECIMAL PLACES Specifies the number of decimal places to use when displaying numbers.

19 IME MODE Controls the conversion of characters in East Asian versions of Windows.

20 IME SENTENCE MODE Controls the conversion of characters in East Asian versions of Windows.

21 SHOW DATE PICKER Specifies whether to show the Date Picker control.

22 FORMAT FOR DATA FIELDS

23 FORMAT FOR NUMBER AND CURRENCY FIELDS

24 If you don't specify a custom format for numeric and currency values, Access displays numbers in the General Number format and currencies in the Currency format. To create a custom format, use the formatting characters shown in the following table. You can also specify a color in which you want the number or currency.

25 CharacterDescription #Used to display a digit. Each instance of the character represents a position for one number. If no value exists in a position, Access displays a blank space. Also, can be used as a placeholder. For example, if you apply the format #,### and enter a value of 45 in the field, 45 is displayed. If you enter 12,145 in a field, Access displays 12,145 — even though you defined only one placeholder to the left of the thousands separator. 0Used to display a digit. Each instance of the character represents a position for one number. If no value exists in a position, Access displays a zero (0). Thousands and decimal separatorsUsed to indicate where you want Access to place the thousands and decimal separators. Access uses the separators that are defined for your Windows regional settings.

26 CharacterDescription blank spaces, + - $ () Used to insert blank spaces, math characters (+ -), and financial symbols (¥ £ $) as needed anywhere in your format strings. If you want to use other common math symbols, such as slash (\ or /) and the asterisk (*), surround them with double quotation marks. Note that you can place them anywhere. \ Used to force Access to display the character that immediately follows. This is the same as surrounding a character with double quotation marks. ! Used to force the left alignment of all values. When you force left alignment, you cannot use the # and 0 digit placeholders, but you can use placeholders for text characters.

27 CharacterDescription * Used to force the character immediately following the asterisk to become a fill character — a character used to fill blank spaces. Access normally displays numeric data as right-aligned, and it fills any area to the left of the value with blank spaces. You can add fill characters anywhere in a format string, and when you do so, Access fills any blank spaces with the specified character. % Used as the last character in a format string. Multiplies the value by 100 and displays the result with a trailing percent sign. E+, E- –or– e+, e- Used to display values in scientific (exponential) notation. Use this option when the predefined scientific format doesn't provide sufficient room for your values. Use E+ or e+ to display values as positive exponents, and E- or e- to display negative exponents. You must use these placeholders with other characters.

28 CharacterDescription "Literal text" Use double quotation marks to surround any text that you want users to see. [color] Used to apply a color to all values in a section of your format. You must enclose the name of the color in brackets and use one of these names: black, blue, cyan, green, magenta, red, yellow, or white.

29 FORMAT FOR TEXT AND MEMO FIELD

30 The Text and Memo data types do not accept predefined formats. The Text data type accepts only custom formats, the Memo data type accepts both custom and Rich Text formatting. Typically, you apply custom formats to Text and Memo data types to make the table data easier to read. For example, if you use a Web form to collect credit card numbers, and you store those numbers without spaces, you can use a custom format to add the appropriate spaces to make the credit card numbers easier to read. Custom formats for the Text and Memo data types allow only two format sections in a string. The first section of a format string controls the appearance of text, and the second section displays empty values or zero-length strings. If you don't specify a format, Access left aligns all text in datasheets.

31 CharacterDescription @ Used to display any available character for its position in the format string. If Access places all characters in the underlying data, any remaining placeholders appear as blank spaces. & Used to display any available character for its position in the format string. If Access places all characters in the underlying data, any remaining placeholders display nothing. ! Used to force placeholder characters to be filled from left to right instead of right to left. You must use this character at the start of any format string. < Used to force all text to lowercase. You must use this character at the beginning of a format string, but you can precede it with an exclamation point (!). > Used to force all text to uppercase. You must use this character at the beginning of a format string, but you can precede it with an exclamation point (!).

32 CharacterDescription * When used, the character immediately after the asterisk (*) becomes a fill character — a character used to fill blank spaces. Access normally displays text as left-aligned and fills any area to the right of the value with blank spaces. You can add fill characters anywhere in a format string. When you do so, Access fills any blank spaces with the specified character. Blank space, + - $ () Used to insert blank spaces, math characters (+ -), financial symbols ($ ¥ £), and parentheses as needed anywhere in your format strings. If you want to use other common math symbols, such as slash (\ or /) and the asterisk (*), surround them with double quotation marks — note that you can place these characters anywhere in the format string. "Literal text" Use double quotation marks to surround any text that you want displayed to users.

33 CharacterDescription \ Used to force Access to display the character that immediately follows. This is the same as surrounding a character with double quotation marks. [color] Used to apply a color to all values in a section of your format. You must enclose the name in brackets and use one of these names: black, blue, cyan, green, magenta, red, yellow, or white.

34 FORMAT FOR DATE AND TIME FIELD

35 If you don't specify a predefined or custom format, Access applies the General Date format — m/dd/yyyy h:nn:ss AM/PM. Custom formats for the Date/Time fields can contain two sections — one for the date and another for time — and you separate the sections with a semicolon. For example, you can re-create the General Date format as follows: m/dd/yyyy;h:nn:ss.

36 CharacterDescription Date separator Used to control where Access places the separator for days, months, and years. Access uses the separator defined in your Windows regional settings. cUsed to display the general date format. d or dd Used to display the day of the month as one or two digits. For one digit, use a single placeholder. For two digits, use two placeholders. ddd Used to abbreviate the day of the week to three letters ddddUsed to spell out all days of the week. dddddUsed to display the Short Date Format ddddddUsed to display the Long Date Format w Used to display the number of the day of the week. m or mm Used to display the month as either a one-digit or two-digit number

37 CharacterDescription mmm Used to abbreviate the name of the month to three letters. mmmmUsed to spell out all month names. q Used to display the number of the current calendar quarter (1-4). yUsed to display the day of the year (1-366). yyUsed to display the last two digits of the year. yyyy Used to display all digits in a year in the range 0100-9999. Time separator Used to control where Access places the separator for hours, minutes, and seconds. Access uses the separator defined in your Windows regional settings. h or hhUsed to display the hour as one or two digits. n or nnUsed to display minutes as one or two digits. s or ssUsed to display seconds as one or two digits. tttttUsed to display the Long Time format.

38 CharacterDescription AM/PM Used to display 12-hour clock values with a trailing AM or PM. Access relies on the system clock in your computer to set the value. A/P or a/p Used to display 12-hour clock values with a trailing A, P, a, or p. Access relies on the system clock in your computer to set the value. AMPM Used to display 12-hour clock values. Access uses the morning and afternoon indicators specified in your Windows regional settings. Blank space, + - $ () Used to insert blank spaces, math characters (+ -), financial symbols ($ ¥ £), and parentheses as needed anywhere in your format strings. If you want to use other common math symbols, such as slash (\ or /) and the asterisk (*), surround them with double quotation marks. Note that you can place them anywhere. \ Used to force Access to display the character that immediately follows. This is the same as surrounding a character with double quotation marks.

39 CharacterDescription * Used to force the character immediately following the asterisk to become a fill character — a character used to fill blank spaces. Access normally displays text as left aligned and fills any area to the right of the value with blank spaces. You can add fill characters anywhere in a format string. When you do so, Access fills any blank spaces with the specified character. "Literal text" Use double quotation marks to surround any text that you want users to see. [color] Used to apply a color to all values in a section of your format. You must enclose the name in brackets and use one of these names: black, blue, cyan, green, magenta, red, yellow, or white.

40 VALIDATION RULE

41

42 WHAT IS VALIDATION RULE A validation rule limits or controls what users can enter in a table field or a control (such as a text box) on a form.

43 SYNTAX FOR CREATING A VALIDATION RULE OperatorFunctionExample NOT Tests for converse values. Use before any comparison operator except IS NOT NULL. NOT > 10 (the same as <=10). ININ Tests for values equal to existing members in a list. Comparison value must be a comma- separated list enclosed in parentheses. IN ("Tokyo","Paris","Moscow") BETWEEN Tests for a range of values. You must use two comparison values — low and high — and you must separate those values with the AND separator. BETWEEN 100 AND 1000 (the same as >=100 AND <=1000) LIKE Matches pattern strings in Text and Memo fields. LIKE "Geo*"

44 OperatorFunctionExample IS NOT NULL Forces users to enter values in the field. This is the same as setting the Required field property to Yes. However, when you enable the Required property and a user fails to enter a value, Access displays a somewhat unfriendly error message. Typically, your database is easier to use if you use IS NOT NULL and enter a friendly message in the Validation Text property. IS NOT NULL AND Specifies that all the data that you enter must be true or fall within limits that you specify. >= #01/01/2007# AND <=#03/06/2008# Note You can also use AND to combine validation rules. For example: NOT "UK" AND LIKE "U*". OR Specifies that one or more pieces of data can be true. January OR February

45 OperatorFunctionExample <Less than. <=Less than or equal to. >Greater than. >=Greater than or equal to. =Equal to. <>Not equal to.

46 EXAMPLES OF VALIDATION RULES Validation ruleValidation text <>0Enter a nonzero value. >=0 Value must be zero or greater.-or- You must enter a positive number. 0 or >100Value must be either 0 or greater than 100. BETWEEN 0 AND 1 Enter a value with a percent sign. (For use with a field that stores number values as percentages). <#01/01/2007#Enter a date before 2007. >=#01/01/2007# AND <#01/01/2008#Date must occur in 2007. <Date()Birth date cannot be in the future. StrComp(UCase([LastName]), [LastName],0) = 0 Data in a field named LastName must be uppercase. >=Int(Now())Enter today's date.

47 Validation ruleValidation text M Or FEnter M for male or F for female. LIKE "[A-Z]*@[A-Z].com" OR "[A-Z]*@[A-Z].net" OR "[A-Z]*@[A-Z].org" Enter a valid.com,.net, or.org e-mail address. [RequiredDate]<=[OrderDate]+30 Enter a required date that occurs no more than 30 days after the order date. [EndDate]>=[StartDate]Enter an ending date on or after the start date.

48 VALIDATION RULE REFERENCE The following tables provide reference information for validation rules, including the syntax that the most common rules use, links to information about using wildcard characters in your rules, and examples that you can adapt for use with your data.


Download ppt "INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014."

Similar presentations


Ads by Google