Chapterبەش 2 · Lectureوانە 2.3

Default Values and Validation Rulesنرخە بنەڕەتییەکان و ڕێساکانی پشتڕاستکردنەوە

Stop wrong data at the door: default values, validation rules and messages with Access's operators, the class project's DOB and Age rules, Required, Allow Zero Length (Null vs ""), Indexed and record rules in the table properties.

ڕێگە لە هەڵە بگرە لە دەرگاوە: ، و پەیامەکان بە Access، ڕێساکانی DOB و Ageـی پڕۆژەی پۆل، Required، ⁦Allow Zero Length (Null⁩ و "")، Indexed و ڕێسای لە تایبەتمەندییەکانی .

13 min read15 خولەک خوێندنەوە · 15 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Set default values, and tell a 0 that means something from an empty value.
  • Write validation rules with Access operators and helpful validation texts.
  • Use Required, Allow Zero Length (Null vs "") and Indexed, and write a record rule in the table properties.
  • دابنێیت و 0ـێک کە واتای هەیە لە نرخێکی بەتاڵ جیا بکەیتەوە.
  • بە Access و ⁦Validation Text⁩ـی بەسوود بنووسیت.
  • Required، ⁦Allow Zero Length (Null⁩ و "") و Indexed بەکاربهێنیت و ڕێسای لە تایبەتمەندییەکانی بنووسیت.

From formats to rulesلە Formatـەوە بۆ ڕێسا

Lesson 3 gave every field its size, display format, input mask and lookup list. Those properties shape how values are typed and shown. This lesson adds the properties that check the value itself: a default value for new records, validation rules with their messages, Required, Allow Zero Length and Indexed, and rules on the whole table. We finish the class project: the department default, the DOB rule and the Age rule.

وانەی 3 قەبارە، Formatـی پیشاندان، و دا بە هەموو . ئەو تایبەتمەندییانە دیاری دەکەن نرخەکان چۆن دەنووسرێن و پیشان دەدرێن. ئەم وانەیە ئەو تایبەتمەندییانە زیاد دەکات کە خودی نرخەکە دەپشکنن: بۆ نوێ، لەگەڵ پەیامەکانیان، Required، ⁦Allow Zero Length⁩ و Indexed، هەروەها ڕێسا لەسەر هەموو . پڕۆژەی پۆلەکە تەواو دەکەین: بەشی بنەڕەتی، ڕێسای DOB و ڕێسای Age.

Quick checkپشکنینی خێراWhich property from lesson 3 only changes how a value is shown, and checks nothing?کام تایبەتمەندی لە وانەی 3 تەنها شێوەی پیشاندانی نرخ دەگۆڕێت و هیچ شتێک ناپشکنێت؟

Default Value⁦Default Value⁩ و تۆمارەکانی نوێ

A is put into the field of every new record; the user can change it. In the project, Department starts as IT, the department most students choose. Text defaults are written in double quotes: "IT".

دەخرێتە ناو هەموو نوێ؛ بەکارهێنەر دەتوانێت بیگۆڕێت. لە پڕۆژەکەدا، Department بە IT دەست پێدەکات، ئەو بەشەی زۆربەی قوتابیان هەڵیدەبژێرن. دەق لە نێوان دوو جووت کۆتەیشندا دەنووسرێن: "IT".

The Student table in Design view with the Department row selected (Short Text). In the Field Properties pane Field Size is 10 and the Default Value row, "IT", is highlighted; the help box says it is the value automatically entered in this field for new records.خشتەی Student لە پیشاندانی Designـدا و ڕیزی Department هەڵبژێردراوە (Short Text). لە پانێڵی Field Properties، Field Size 10ـە و ڕیزی Default Value، "IT"، دیاری کراوە؛ سندووقی یارمەتی دەڵێت ئەمە ئەو نرخەیە کە خۆکارانە بۆ تۆمارەکانی نوێ لەم ستوونەدا دەنووسرێت.
The project's default value, redrawn: Department starts as "IT" پڕۆژەکە، دووبارە کێشراو: Department بە "IT" دەست پێدەکاتCêIT
Useful default values بەسوود
FieldDefault ValueEffectکاریگەری
Department"IT"every new student starts in ITهەموو قوتابییەکی نوێ لە IT دەست پێدەکات
EnrolDate=Date()today's date when the enrolment is typedڕێکەوتی ئەمڕۆ کاتی نووسینی تۆمارکردنەکە
a time stamp=Now()today's date and the current timeڕێکەوتی ئەمڕۆ و کاتی ئێستا
a quantityژمارەی دانە1most orders are for one itemزۆربەی داواکارییەکان بۆ یەک دانەن
City"Erbil"only if most students really come from Erbilتەنها ئەگەر زۆربەی قوتابیان بە ڕاستی خەڵکی Erbil بن

In SQL the same idea is the DEFAULT column rule (CREATE TABLE today).

لە SQLـدا هەمان بیرۆکە ڕێسای DEFAULTـی ستوونە (⁦CREATE TABLE⁩ ی ئەمڕۆ).

Quick checkپشکنینی خێراYou type a new enrolment and leave EnrolDate alone. Its Default Value is =Date(). What is stored?تۆمارکردنێکی نوێ دەنووسیت و دەست لە EnrolDate نادەیت. ⁦Default Value⁩ـەکەی =Date()ـە. چی هەڵدەگیرێت؟

Validation rules and messagesڕێساکانی پشتڕاستکردنەوە و پەیامەکان

A is a condition that every new or changed value must meet. If a value breaks it, Access refuses the value and shows the field's Validation Text (or its own message if you wrote none); you must correct the value — or press Esc — before you can leave the field or save the record. Write the rule in the Validation Rule box (the … button opens the Expression Builder with functions, constants and operators to click), or on the Table Fields tab → Validation.

کە هەموو نرخێکی نوێ یان گۆڕاو دەبێت جێبەجێی بکات. ئەگەر نرخێک بیشکێنێت، Access ڕەتی دەکاتەوە و ⁦Validation Text⁩ـی پیشان دەدات (یان پەیامی خۆی ئەگەر هیچت نەنووسیبێت)؛ دەبێت نرخەکە ڕاست بکەیتەوە — یان Esc دابگریت — پێش ئەوەی بتوانیت بەجێ بهێڵیت یان پاشەکەوت بکەیت. ڕێساکە لە سندووقی ⁦Validation Rule⁩ بنووسە ( … ⁦Expression Builder⁩ دەکاتەوە کە ، و تێدایە بۆ لێکردن)، یان لە ⁦Table Fields⁩ ← Validation.

Quick checkپشکنینی خێراAge has the rule >=18 And <=50 and someone types 60. What happens?Age ڕێسای >=18 And <=50ـی هەیە و کەسێک ⁦60⁩ دەنووسێت. چی ڕوو دەدات؟

15. Field Properties for NumberKurdistan College · Kurdish (Sorani)کوردی (سۆرانی) · 2.3K viewsبینین · 62 likesلایک · Partبەشی 10:20–13:58 (ofلە 13:58)

Kurdish: Number field properties - Field Size limits (Integer refuses 32,768), Decimal Places, Default Value, then a Validation Rule with a Kurdish message.

بە کوردی: ⁦Number: Field Size (Integer⁩ ژمارەی ⁦32,768⁩ ڕەت دەکاتەوە)، ⁦Decimal Places⁩، ، پاشان بە پەیامێکی کوردی.

Kurdish (Sorani), plays 10:20 to the end: a Validation Rule on Age and a Validation Text written in Kurdish; Access warns that old data may break the new rule, and a wrong age is refused with the message.

بە کوردیی سۆرانی، لە ⁦10:20⁩ تا کۆتایی پەخش دەبێت: لەسەر Age و ⁦Validation Text⁩ بە کوردی؛ Access ئاگادار دەکاتەوە کە لەوانەیە کۆن بشکێنێت، پاشان تەمەنی هەڵە بە پەیامەکە ڕەت دەکرێتەوە.

Validation rules and messagesڕێساکانی پشتڕاستکردنەوە و پەیامەکان

Access expression operatorsکارپێکەرەکانی دەربڕینی Access

This table is the one place in the course that lists Access's expression operators; lesson 6 uses the same ones in query criteria. Text goes in double quotes, numbers do not, dates go between # signs, and text comparisons do not care about upper and lower case ("it" matches IT).

ئەم تاکە شوێنی کۆرسەکەیە کە Access لیست دەکات؛ وانەی 6 هەمان ئەوانە لە بەکاردەهێنێت. دەق لە نێوان دوو جووت کۆتەیشندایە، ژمارە نا، ڕێکەوت لە نێوان نیشانەی #ـدایە و بەراوردی دەق گوێ بە پیتی گەورە و بچووک نادات ("it" لەگەڵ IT دەگونجێت).

Access expression operators Access
OperatorMeaningواتاExampleنموونە
= <>equal (often left out) · not equalیەکسان (زۆرجار نانووسرێت) · نایەکسان<>0
< <= > >=smaller, smaller or equal, bigger, bigger or equalبچووکتر، بچووکتر یان یەکسان، گەورەتر، گەورەتر یان یەکسان>=0 (FeeIQD)
Andboth parts must be trueدەبێت هەردوو بەش ڕاست بن>=18 And <=50
Orat least one part must be trueدەبێت لانی کەم یەک بەش ڕاست بێت"Diploma" Or "Bachelor" Or "Master"
Notthe opposite of what followsپێچەوانەی ئەوەی دوای دێتNot Like "*[0-9]*"
Between … And …from … to …, both ends includedلە … تا …، هەردوو سەر لەگەڵیداBetween 1 And 4 (Stage)
In (…)one of the values in the listیەکێک لە نرخەکانی لیستەکەIn ("Diploma","Bachelor","Master")
Likematches a pattern with : ? one character, * any characters, # one digit, [A-Z] one letter in the range, [!0-9] one character that is not a digitلەگەڵ شێوەیەکی دیاریکراو دەگونجێت بە : ? یەک ، * هەر چەند ، # یەک ژمارە، [A-Z] یەک پیت لە نێوان A و Z، [!0-9] یەک کە ژمارە نەبێتLike "[A-Z][A-Z]##" (CourseCode)
Is Null · Is Not Nullempty · not emptyبەتاڵ · بەتاڵ نییەIs Not Null
Date() · Now()today · today and the current timeئەمڕۆ · ئەمڕۆ و کاتی ئێستا<=Date() (DOB)
[Field]another field's value, in square brackets (record rules)نرخی تر، لە ناو کەوانەی چوارگۆشەدا (ڕێسای )[EndDate]>=[StartDate]
+ - * /arithmeticژمێرکاری[EndDate]<=[StartDate]+120
&joins text (used in queries and forms)دەق بە یەکەوە دەلکێنێت (لە و بەکاردێت)[StudentName] & " (" & [City] & ")" → Aram (Sulaimani)
Quick checkپشکنینی خێراWhich rule accepts CS21 but refuses CS2A?کام ڕێسا ⁦CS21⁩ وەردەگرێت بەڵام ⁦CS2A⁩ ڕەت دەکاتەوە؟

Validation rules and messagesڕێساکانی پشتڕاستکردنەوە و پەیامەکان

Rules and messages for our labڕێسا و پەیامەکان بۆ تاقیگەکەمان

Rules and messages for our lab (a Validation Text can be written in Kurdish)ڕێسا و پەیامەکان بۆ تاقیگەکەمان (⁦Validation Text⁩ دەکرێت بە کوردی بنووسرێت)
FieldValidation RuleValidation Text
MarkBetween 0 And 100A mark is a whole number from 0 to 100.نمرە ژمارەیەکی تەواوە لە 0 تا ⁦100⁩.
StageBetween 1 And 4Stage must be 1, 2, 3 or 4.قۆناغ دەبێت 1، 2، 3 یان 4 بێت.
FeeIQD>=0A fee cannot be negative.کرێ ناتوانێت سالب بێت.
DOB<=Date()A birth date cannot be in the future.ڕێکەوتی لەدایکبوون ناتوانێت لە داهاتوودا بێت.
CourseTypeIn ("Diploma","Bachelor","Master")Choose Diploma, Bachelor or Master.Diploma، Bachelor یان Master هەڵبژێرە.
CourseCodeLike "[A-Z][A-Z]##"Two letters and two digits, for example IT11.دوو پیت و دوو ژمارە، بۆ نموونە ⁦IT11⁩.
EnrolDate>=#2026-09-01#This year's enrolment starts on 1 September 2026.تۆمارکردنی ئەمساڵ لە 1ی ⁦September 2026⁩ دەست پێدەکات.
StudentNameNot Like "*[0-9]*"A name cannot contain digits.ناو ناتوانێت ژمارەی تێدا بێت.
Quick checkپشکنینی خێراWhich rule lets CourseType be only Diploma, Bachelor or Master?کام ڕێسا ڕێگە دەدات CourseType تەنها Diploma، Bachelor یان Master بێت؟

Validation rules and messagesڕێساکانی پشتڕاستکردنەوە و پەیامەکان

Testing rules, and what rules do not checkتاقیکردنەوەی ڕێساکان و ئەوەی ڕێساکان نایپشکنن

  • Test Validation Rules (Table Design → Tools) checks the records you already have against new rules; Access also offers the test when you save a stricter rule.
  • AutoNumber, OLE Object, Attachment and Replication ID fields cannot have a validation rule.
  • An empty value is not tested: Between 0 And 100 lets an empty Mark through. To forbid empty values, use Required (next screens) or add Is Not Null.
  • The SQL twin of a validation rule is CHECK (column rules); websites check input in the same spirit (why validate).
  • ⁦Test Validation Rules⁩ (⁦Table Design⁩ ← Tools) ئەو پێشتر هەتن بەرامبەر ڕێسا نوێیەکان دەپشکنێت؛ Access کاتی پاشەکەوتکردنی ڕێسایەکی توندتریش تاقیکردنەوەکە پێشنیار دەکات.
  • AutoNumber، ⁦OLE Object⁩، Attachment و ⁦Replication ID⁩ ناتوانن هەبێت.
  • نرخێکی بەتاڵ تاقی ناکرێتەوە: Between 0 And 100 ڕێگە بە Markـی بەتاڵ دەدات. بۆ قەدەغەکردنی نرخی بەتاڵ، Required بەکاربهێنە (شاشەکانی دواتر) یان Is Not Null زیاد بکە.
  • هاوشێوەی SQLـی CHECKـە (ڕێساکانی ستوون)؛ ماڵپەڕەکان بە هەمان بیرۆکە دەپشکنن (بۆچی پشتڕاستکردنەوە).
Quick checkپشکنینی خێراMark has the rule Between 0 And 100, and Hana's Mark is left empty. What happens?Mark ڕێسای Between 0 And 100ـی هەیە و Markـی هانا بەتاڵ بەجێ دەهێڵدرێت. چی ڕوو دەدات؟

The project's two rulesدوو ڕێساکەی پڕۆژەکە

The project's DOB rule was >=#1/1/1990# And <=#1/1/2000# with the Validation Text Only between 1/1/1990 and 1/1/2000 is allowed! The shorter form says the same: Between #1/1/1990# And #1/1/2000#. Because # dates are read month/day/year, write it as Between #1990-01-01# And #2000-01-01# — here both readings happen to agree, but the ISO form never misleads. Between includes both ends, so Hana (6), born on 2000-01-01, is accepted.

ڕێسای DOBـی پڕۆژەکە >=#1/1/1990# And <=#1/1/2000# بوو بە ⁦Validation Text⁩ـی ⁦Only between 1/1/1990 and 1/1/2000 is allowed!⁩ شێوە کورتەکە هەمان شت دەڵێت: Between #1/1/1990# And #1/1/2000#. چونکە ڕێکەوتی ناو # وەک مانگ/ڕۆژ/ساڵ دەخوێنرێتەوە، بە Between #1990-01-01# And #2000-01-01# بینووسە — لێرەدا هەردوو خوێندنەوە بە ڕێکەوت یەک دەگرنەوە، بەڵام شێوەی ISO هەرگیز هەڵە نادات. Between هەردوو سەر لەخۆ دەگرێت، بۆیە هانا ⁦(6)⁩ کە لە ⁦2000-01-01⁩ لەدایک بووە وەردەگیرێت.

Two Field Properties panels redrawn from the project's screens. Left, DOB (Date/Time): Format Short Date, Caption 'Date of birth', Validation Rule Between #1990-01-01# And #2000-01-01# and Validation Text 'Only dates from 1/1/1990 to 1/1/2000!' highlighted, Show Date Picker For dates; the note: the rule lets in only dates from 1/1/1990 to 1/1/2000, and the Validation Text appears for a date outside that range such as 28/2/2001 because the upper limit is 1/1/2000. Right, Age (Number): Field Size Byte and Validation Rule >=18 And <=50 highlighted, Validation Text 'Only between 18 and 50 is allowed!'; the corrected note: only ages 18 to 50 are allowed, anything else shows the Validation Text; the photo's note said 'to 15' but the rule says 50; Byte is enough for an age, the project had used Long Integer.دوو پانێڵی Field Properties کە لە شاشەکانی پڕۆژەکەوە دووبارە کێشراونەتەوە. چەپ، DOB (Date/Time): Format Short Date، Caption «Date of birth»، Validation Rule بە Between #1990-01-01# And #2000-01-01# و Validation Text بە «Only dates from 1/1/1990 to 1/1/2000!» دیاری کراون، Show Date Picker For dates؛ تێبینییەکە: ڕێساکە تەنها ڕێگە بە ڕێکەوتی 1/1/1990 تا 1/1/2000 دەدات و Validation Text بۆ ڕێکەوتێکی دەرەوەی ئەو سنوورە وەک 28/2/2001 دەردەکەوێت چونکە سنووری سەرەوە 1/1/2000ـە. ڕاست، Age (Number): Field Size بە Byte و Validation Rule بە >=18 And <=50 دیاری کراون، Validation Text «Only between 18 and 50 is allowed!»؛ تێبینییە ڕاستکراوەکە: تەنها تەمەنی 18 تا 50 ڕێگەپێدراوە، هەر شتێکی تر Validation Text پیشان دەدات؛ تێبینیی وێنەکە «تا 15»ـی نووسیبوو بەڵام ڕێساکە دەڵێت 50؛ Byte بۆ تەمەن بەسە، پڕۆژەکە Long Integerـی بەکارهێنابوو.
The project's DOB and Age screens, redrawn with the student's notesشاشەکانی DOB و Ageـی پڕۆژەکە، دووبارە کێشراو لەگەڵ تێبینییەکانی قوتابییەکەCêIT

The note's example 28/2/2001 is written day/month/year, the way dates are typed in Kurdistan. That is fine for typing into the cell when Windows uses day/month/year; only the #…# dates inside the rule are read month/day/year.

نموونەکەی تێبینییەکە، ⁦28/2/2001⁩، بە ڕۆژ/مانگ/ساڵ نووسراوە، بەو شێوەیەی لە کوردستان ڕێکەوت دەنووسرێت. ئەمە بۆ نووسین لە خانەکەدا باشە کاتێک Windows ڕۆژ/مانگ/ساڵ بەکاردەهێنێت؛ تەنها ڕێکەوتەکانی #…# لە ناو ڕێساکەدا بە مانگ/ڕۆژ/ساڵ دەخوێنرێنەوە.

Quick checkپشکنینی خێراWith Between #1990-01-01# And #2000-01-01#, which DOB is refused?بە Between #1990-01-01# And #2000-01-01#، کام DOB ڕەت دەکرێتەوە؟

The project's two rulesدوو ڕێساکەی پڕۆژەکە

The Age rule, and an age that goes staleڕێسای Age و تەمەنێک کە کۆن دەبێت

Quick checkپشکنینی خێراWhy is storing Age next to DOB a design problem?بۆچی هەڵگرتنی Age لە تەنیشت DOB کێشەیەکی دیزاینە؟

Required, Allow Zero Length and IndexedRequired، ⁦Allow Zero Length⁩ و Indexed

Required = Yes means a record cannot be saved while this field is empty: no student without a name, no country without a name. It is Access's version of NOT NULL (integrity rules). Phone stays Required = No, because Lana's phone is unknown.

⁦Required = Yes⁩ واتە پاشەکەوت ناکرێت تا ئەم بەتاڵ بێت: هیچ قوتابییەک بەبێ ناو، هیچ وڵاتێک بەبێ ناو. ئەمە وەشانی Accessـە بۆ NOT NULL (ڕێساکانی دروستی). Phone بە ⁦Required = No⁩ دەمێنێتەوە، چونکە ژمارەی تەلەفۆنی لانا نەزانراوە.

Allow Zero Length (Short Text, Long Text, Hyperlink) decides whether an empty text "" may be stored. Empty-looking cells can mean two different things: Null = we do not know (Lana's phone has not been collected), and a zero-length string "" = we know there is none (a student who has no phone at all). With Allow Zero Length = Yes you can type "" to say "none". For StudentName set it to No: with Required = Yes but Allow Zero Length = Yes, someone could still save a "name" that is just "". More on Null: Null values.

⁦Allow Zero Length⁩ (⁦Short Text⁩، ⁦Long Text⁩، Hyperlink) دیاری دەکات ئایا دەقی بەتاڵی "" دەکرێت هەڵبگیرێت. خانەیەک کە بەتاڵ دیار بێت دەکرێت دوو واتای جیاوازی هەبێت: Null = نازانین (ژمارەی تەلەفۆنی لانا هێشتا کۆ نەکراوەتەوە) و دەقی بێ درێژیی "" = دەزانین کە نییەتی (قوتابییەک کە هیچ تەلەفۆنێکی نییە). بە ⁦Allow Zero Length = Yes⁩ دەتوانیت "" بنووسیت بۆ وتنی «نییە». بۆ StudentName بیکە بە No: ئەگەر ⁦Required = Yes⁩ بێت بەڵام ⁦Allow Zero Length = Yes⁩، کەسێک دەتوانێت «ناوێک» پاشەکەوت بکات کە تەنها ""ـە. زیاتر دەربارەی Null: نرخەکانی NULL.

Quick checkپشکنینی خێراLana's phone number has not been collected yet. What should her Phone cell hold?ژمارەی تەلەفۆنی لانا هێشتا کۆ نەکراوەتەوە. خانەی Phoneـی دەبێت چی هەڵبگرێت؟

Required, Allow Zero Length and IndexedRequired، ⁦Allow Zero Length⁩ و Indexed

Indexedتایبەتمەندیی Indexed

Indexed has three settings: No; Yes (Duplicates OK) — an index that makes searching and sorting on this field faster; Yes (No Duplicates) — a unique index that also refuses a repeated value (unique key). Set CountryName to Yes (No Duplicates): typing Iraq a second time is refused. Every index makes saving a little slower, so index only fields you search often. The primary key is always indexed (No Duplicates); leave it alone. An index on several fields is made in Table Design → Indexes.

Indexed سێ ڕێکخستنی هەیە: No؛ ⁦Yes (Duplicates OK)⁩ — پێڕستێک کە گەڕان و ڕیزکردن لەسەر ئەم خێراتر دەکات؛ ⁦Yes (No Duplicates)⁩ — یەکتا کە نرخی دووبارەش ڕەت دەکاتەوە (کلیلی یەکتا). CountryName بکە بە ⁦Yes (No Duplicates)⁩: نووسینی Iraq بۆ جاری دووەم ڕەت دەکرێتەوە. هەر پاشەکەوتکردن کەمێک هێواشتر دەکات، بۆیە تەنها بۆ ئەو زۆر لێیان دەگەڕێیت دروست بکە. هەمیشە هەیە ⁦(No Duplicates)⁩؛ دەستی لێ مەدە. لەسەر چەند لە ⁦Table Design⁩ ← Indexes دروست دەکرێت.

The lab's settingsڕێکخستنەکانی تاقیگە
FieldRequiredAllow Zero LengthIndexed
StudentNameYesNoNo
PhoneNoYesNo
DepartmentYesNoYes (Duplicates OK)
CountryNameYesNoYes (No Duplicates)
CourseCode (key)YesNoYes (No Duplicates)
Quick checkپشکنینی خێراCountryName has Indexed = Yes (No Duplicates). What happens when you type Iraq a second time?⁦CountryName Indexed = Yes (No Duplicates)⁩ـی هەیە. کاتێک Iraq بۆ جاری دووەم دەنووسیت چی ڕوو دەدات؟

Table propertiesتایبەتمەندییەکانی خشتە

A table also has properties of its own. In click Table Design → Property Sheet; with no field selected it shows Table Properties:

خۆی تایبەتمەندیی تایبەتی خۆشی هەیە. لە لە ⁦Table Design⁩ ← ⁦Property Sheet⁩ بکە؛ کاتێک هیچ هەڵنەبژێردرابێت ⁦Table Properties⁩ پیشان دەدات:

Useful table propertiesتایبەتمەندییە بەسوودەکانی
PropertyتایبەتمەندیWhat it doesچی دەکاتExampleنموونە
Descriptiona note about the table, shown in the Navigation Pane's detailsتێبینییەک دەربارەی ، لە وردەکارییەکانی پیشان دەدرێتOne row per studentیەک ڕیز بۆ هەر قوتابییەک
Default Viewhow the table opens (Datasheet) چۆن دەکرێتەوە ⁦(Datasheet)⁩Datasheet
Validation Rule, Validation Texta record rule that compares fields of the same recordڕێسای کە هەمان بەراورد دەکات[EndDate]>=[StartDate]
Filter, Order By, Filter On Load, Order By On Loadopen the table filtered or sorted بە یان ڕیزکراوی دەکاتەوەOrder By StudentName + Order By On Load Yes⁦Order By StudentName⁩ و ⁦Order By On Load Yes⁩
Subdatasheet Name, Expanded, Height; Link Child/Master Fieldswhich related records open under the + sign (lesson 5)کام پەیوەندیدار لە ژێر نیشانەی + دەکرێنەوە (وانەی ⁦5⁩)[Auto]
OrientationLeft-to-Right or Right-to-Left: with Right-to-Left the first field is at the right and the datasheet reads from the right⁦Left-to-Right⁩ یان ⁦Right-to-Left⁩: بە ⁦Right-to-Left⁩ یەکەم لە لای ڕاستە و لە ڕاستەوە دەخوێنرێتەوەuseful for Kurdish dataبۆ کوردی بەسوودە

A field rule sees one field; a record rule sees the whole record, so it can compare two fields. Access checks it when you leave the record. Try it in the exercises with a Semester table.

ڕێسای یەک دەبینێت؛ ڕێسای هەموو دەبینێت، بۆیە دەتوانێت دوو بەراورد بکات. Access کاتێک بەجێدەهێڵیت دەیپشکنێت. لە ڕاهێنانەکاندا بە Semester تاقی بکەرەوە.

Quick checkپشکنینی خێراWhere do you write a rule that compares EndDate with StartDate?ڕێسایەک کە EndDate لەگەڵ StartDate بەراورد دەکات لە کوێ دەنووسیت؟

Common mistakesهەڵە باوەکان

MistakeهەڵەFixچارە
Dates like #2/1/2000# in rulesڕێکەوتی وەک #2/1/2000# لە ڕێساکانداwrite #2000-02-01# (it is read month/day/year)#2000-02-01# بنووسە (بە مانگ/ڕۆژ/ساڵ دەخوێنرێتەوە)
Storing Age next to DOBهەڵگرتنی Age لە تەنیشت DOBit goes stale; compute the age from DOB in a query (lesson 6)کۆن دەبێت؛ تەمەن لە DOBـەوە لە بژمێرە (وانەی 6)
A Default 0 in MarkDefaultـی 0 لە Markremove it: 0 ≠ not gradedلای ببە: 0 هەمان «هێشتا نمرەی پێ نەدراوە» نییە
Text values in a rule separated by ;نرخی دەق لە ڕێسادا بە ; جیاکراوەuse Or or In (…)Or یان In (…) بەکاربهێنە
Expecting Between 0 And 100 to refuse an empty Markچاوەڕوانی ئەوەی Between 0 And 100 Markـی بەتاڵ ڕەت بکاتەوەrules skip empty values: use Required = Yes or add Is Not Nullڕێساکان نرخی بەتاڵ تاقی ناکەنەوە: ⁦Required = Yes⁩ بەکاربهێنە یان Is Not Null زیاد بکە
Required = Yes but Allow Zero Length = Yes on StudentName⁦Required = Yes⁩ بەڵام ⁦Allow Zero Length = Yes⁩ لەسەر StudentNameset Allow Zero Length = No, or a "name" can be just ""⁦Allow Zero Length⁩ بکە بە No، دەنا «ناوێک» دەتوانێت تەنها "" بێت

Exercisesڕاهێنانەکان

ExerciseڕاهێنانRules for Studentڕێسا بۆ Student

Set these on Student: StudentName, Department and CountryID required; names start with a capital and continue in small letters; Age only 18 to 50; Department only from its list. Write the property for each.

ئەمانە لەسەر Student دابنێ: StudentName، Department و CountryID پێویستن؛ ناو بە پیتی گەورە دەست پێدەکات و بە بچووک بەردەوام دەبێت؛ Age تەنها ⁦18⁩ تا ⁦50⁩؛ Department تەنها لە لیستەکەی. تایبەتمەندیی هەر یەکێک بنووسە.

Show answerوەڵامەکە پیشان بدە
NeedپێویستیPropertyتایبەتمەندی
required fields پێویستRequired = Yes (StudentName, Department, CountryID); Allow Zero Length = No
capital + small letters: Input Maskپیتی گەورە و بچووک: ⁦Input Mask⁩>L<??????????????
age 18–50تەمەنی ⁦18⁩ تا ⁦50⁩Field Size Byte; Validation Rule Between 18 And 50; Validation Text
department from the listبەش لە لیستەکەوەLookup: Limit To List = Yes (or Validation Rule In ("IT","CS","Biology","Accounting"))
ExerciseڕاهێنانRules for Courseڕێسا بۆ Course

On Course: CourseCode is exactly two capital letters and two digits; Stage only 1 to 4; CourseType only Diploma, Bachelor or Master; FeeIQD shown as 450,000 IQD.

لەسەر ⁦Course: CourseCode⁩ ڕێک دوو پیتی گەورە و دوو ژمارەیە؛ Stage تەنها 1 تا 4؛ CourseType تەنها Diploma، Bachelor یان Master؛ FeeIQD وەک ⁦450,000 IQD⁩ پیشان بدرێت.

Show answerوەڵامەکە پیشان بدە
  • CourseCode: Field Size 4, Input Mask >LL00 (it also turns it11 into IT11) and, to protect imports too, Validation Rule Like "[A-Z][A-Z]##".
  • Stage: Number, Field Size Byte, Validation Rule Between 1 And 4.
  • CourseType: Lookup Wizard with typed values Diploma; Bachelor; Master and Limit To List = Yes.
  • FeeIQD: Currency, Format #,##0 "IQD", Decimal Places 0, Validation Rule >=0.
  • ⁦CourseCode: Field Size 4⁩، ⁦Input Mask⁩ >LL00 (⁦it11⁩ـیش دەکات بە ⁦IT11⁩) و بۆ پاراستنی هێنانیش ⁦Validation Rule⁩ Like "[A-Z][A-Z]##".
  • ⁦Stage: Number⁩، ⁦Field Size Byte⁩، ⁦Validation Rule⁩ Between 1 And 4.
  • ⁦CourseType: Lookup Wizard⁩ بە نرخی نووسراوی Diploma؛ Bachelor؛ Master و ⁦Limit To List = Yes⁩.
  • ⁦FeeIQD: Currency⁩، Format #,##0 "IQD"، ⁦Decimal Places 0⁩، ⁦Validation Rule⁩ >=0.

Exercisesڕاهێنانەکان

More exercisesڕاهێنانی زیاتر

ExerciseڕاهێنانA record rule: Semester datesڕێسای تۆمار: ڕێکەوتەکانی Semester

Add a table Semester(SemesterID AutoNumber, StartDate, EndDate) with a record rule so that EndDate can never be before StartDate. Test it with StartDate 2026-09-14 and EndDate 2026-09-01.

⁦Semester (SemesterID AutoNumber⁩، StartDate، EndDate) زیاد بکە بە ڕێسای بۆ ئەوەی EndDate هەرگیز پێش StartDate نەبێت. بە ⁦StartDate 2026-09-14⁩ و ⁦EndDate 2026-09-01⁩ تاقی بکەرەوە.

Show answerوەڵامەکە پیشان بدە
  • Semester: Design view → Property Sheet (Table Properties) → Validation Rule [EndDate]>=[StartDate], Validation Text "The end date cannot be before the start date." A record with StartDate 2026-09-14 and EndDate 2026-09-01 is refused when you leave it.
  • Semester: ← ⁦Property Sheet (Table Properties)⁩ ← ⁦Validation Rule⁩ [EndDate]>=[StartDate]، ⁦Validation Text⁩ «⁦The end date cannot be before the start date⁩.». بە ⁦StartDate 2026-09-14⁩ و ⁦EndDate 2026-09-01⁩ کاتی بەجێهێشتنی ڕەت دەکرێتەوە.

Summaryپوختە

  • Default Value fills new records; Validation Rule + Validation Text refuse wrong values; Required forbids empty values.
  • Null = unknown, "" = known to be empty; Indexed (No Duplicates) = a unique index.
  • Dates in rules are read month/day/year: write #yyyy-mm-dd#; Between includes both ends.
  • Table properties hold record rules (two fields compared) and Right-to-Left orientation.
  • ⁦Default Value⁩ نوێ پڕ دەکاتەوە؛ ⁦Validation Rule⁩ و ⁦Validation Text⁩ نرخی هەڵە ڕەت دەکەنەوە؛ Required نرخی بەتاڵ قەدەغە دەکات.
  • Null = نەزانراو، "" = زانراوە کە بەتاڵە؛ ⁦Indexed (No Duplicates)⁩ = یەکتا.
  • ڕێکەوت لە ڕێساکاندا بە مانگ/ڕۆژ/ساڵ دەخوێنرێتەوە: #yyyy-mm-dd# بنووسە؛ Between هەردوو سەر لەخۆ دەگرێت.
  • تایبەتمەندییەکانی ڕێسای (بەراوردی دوو ) و ئاڕاستەی ⁦Right-to-Left⁩ هەڵدەگرن.
Review questionsپرسیارەکانی پێداچوونەوە
What is the difference between Validation Rule and Validation Text?جیاوازیی نێوان ⁦Validation Rule⁩ و ⁦Validation Text⁩ چییە؟

The rule is the condition; the text is the message shown when the condition is broken.

ڕێساکە ؛ دەقەکە ئەو پەیامەیە کە کاتی شکاندنی پیشان دەدرێت.

Does a validation rule test an empty value?ئایا ڕێسای پشتڕاستکردنەوە نرخێکی بەتاڵ تاقی دەکاتەوە؟

No. Use Required = Yes (or add Is Not Null) to forbid empty values.

نەخێر. بۆ قەدەغەکردنی نرخی بەتاڵ ⁦Required = Yes⁩ بەکاربهێنە (یان ⁦Is Not Null⁩ زیاد بکە).

What is the difference between Null and "" in a Short Text field?جیاوازیی نێوان Null و "" لە ستوونێکی ⁦Short Text⁩ چییە؟

Null means we do not know the value; "" means we know there is none.

Null واتە نرخەکە نازانین؛ "" واتە دەزانین کە نییە.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Relationships and Referential Integrityپەیوەندییەکان و دروستیی ئاماژەپێدان

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.