lesson12 modify queries

13
Abdullatif Tarakji [email protected] Modify queries ماتستع تعديل اChanging the fields in a query مستعحقول في ا تغيير الShowing and hiding query fields مستعء حقول ا إظهار و إخفاSpecifying the sort order for queries ماتستع تحديد الترتيب لFormatting fields in a query مستعحقول في ا تنسيق الTo set formatting properties for a field in a query مستعحقل في النسيقات لئص الت لتعيين خصا

Upload: abdullatif-tarakji

Post on 22-Jan-2018

163 views

Category:

Education


0 download

TRANSCRIPT

Abdullatif [email protected]

Modify queries تعديل االستعالمات

Changing the fields in a query تغيير الحقول في االستعالم

Showing and hiding query fields إظهار و إخفاء حقول االستعالم

Specifying the sort order for queries تحديد الترتيب لالستعالمات

Formatting fields in a query تنسيق الحقول في االستعالم

To set formatting properties for a field in a query لتعيين خصائص التنسيقات للحقل في االستعالم

Abdullatif [email protected] Modify queries

تعديل االستعالمات

• After you set up a query, you can modify it by

changing or rearranging the fields,

showing and hiding query fields,

and sorting the query’s results.

• You can also format the fields in a query.

• This section examines some of the ways you can

modify a query.

يمكنك تعديله بـ, بعد إعدادك لالستعالم•

,تغيير أو إعادة ترتيب الحقول

,إظهار و إخفاء حقول االستعالم

.و فرز نتائج االستعالم

.يمكنك أيضاً تنسيق حقول االستعالم•

هذا القسم يشرح بعض الطرق التي تمكنك•

.من تعديل االستعالم

Abdullatif [email protected] Changing the fields in a query

تغيير الحقول في االستعالم

With a query open in Design view, you can add, remove, and rearrange the query’s fields in several ways. To add fields, you can do the following:

• Drag additional fields from the field lists displayed in the top pane to a blank row in the query design grid.

• Insert a field between two other fields by dragging it to the column in the query design grid where you want to place the field. Access moves the other fields in the query to the right.

• Add a field by selecting it from the list in the Field row in the query design grid.

• Click Show Table in the Query Setup group to open the Show Table dialog box, and then select another table or query to include in the query’s record source.

ة وإزالة مع استعالم مفتوح في طريقة عرض التصميم، يمكنك إضاف

. وإعادة ترتيب الحقول في االستعالم في عدة طرق

:حقول، يمكنك القيام بما يليإلضافة

علوي الحقل المعروضة في الجزء القوائم اسحب حقول إضافية من •

.إلى صف فارغ في شبكة تصميم االستعالم

إدراج حقل بين اثنين من الحقول األخرى عن طريق سحبه إلى•

برنامج . العمود في شبكة تصميم االستعالم حيث تريد وضع الحقل

.األخرى في االستعالم إلى اليميناألكسيس يحرك الحقول

بكة من القائمة في صف حقل في شاختياره إضافة حقل عن طريق •

.تصميم االستعالم

بع انقر فوق إظهار الجدول في المجموعة إعداد االستعالم لفتح مر•

فيلتضمينه آخر استعالم أو جدول الحوار إظهار جدول، ثم حدد

.االستعالمسجل مصدر

Abdullatif [email protected]

• To remove a field, click the top of the field’s column in the design grid, and then press Delete or click Delete Columns in the Query Setup group. You cannot use the Undo command to reverse this action.

• The Query Setup group also contains options for inserting and deleting rows (when you need to define additional criteria, for example) and for opening the Expression Builder.

• If you want to change the order of the fields in the grid, click in the top of the column in the design grid (hold down the Shift key and click to select more than one adjacent column), and then drag the field or fields to the new position. Access displays a black bar to indicate the new position.

، ثم ميمالتصالحقل في شبكة عمود إلزالة حقل، انقر فوق رأس •

اضغط حذف أو انقر فوق حذف أعمدة في المجموعة إعداد

. االستعالم

.يمكنك استخدام األمر تراجع لعكس هذا اإلجراءال

أيضا خيارات إلدراج االستعالم المجموعة إعداد تحتوي •

ية، عندما تحتاج إلى تعريف معايير إضاف)وحذف الصفوف

.وفتح منشئ التعبير( على سبيل المثال

ة، انقر فوق إذا كنت ترغب في تغيير ترتيب الحقول في الشبك•

التصميم في أعلى العمود في شبكة

لتحديد العمود وانقر Shiftمفتاحاضغط باستمرار على )

لموقع ، ثم اسحب الحقل أو الحقول (المجاور أكثر من واحد

.شريط أسود لبيان المركز الجديدAccessيعرض . جديد

Abdullatif [email protected] To add, remove, and rearrange fields in a query

و إعادة ترتيب الحقول في االستعالم, إزالة, إلضافة

1. In the Navigation pane, right-click the query, and then click Design View.

2. To insert a field, in the field list in the top pane of the Query Designer, select the field, and then drag the field to the query design grid.

3. To delete a field, click in the top of the field’s column, and then press Delete.

4. To change the order of the fields, click the top of the column for the field you want to move (hold down the Shift key to select more than one column), and then drag the column or columns to the new location.

كليك يمين على , من نافذة جزء التنقل1.

.ثم اضغط على عرض التصميم, االستعالم

ي من قائمة الحقل في الجزء العلو, إلدراج حقل2.

و ثم اسحب, اختر الحقل, من مصمم االستعالم

.الحقل الى شبكة تصميم االستعالم

, اضغط في أعلى عمود الحقل, لحذف حقل3.

.ثم اضغط على حذف

العمود اضغط في أعلى, لتغيير ترتيب الحقول4.

shiftاضغط على )للحقل الذي تريد تحريكه

ثم اسحب العمود أو , (الختيار اكثر من عمود

.األعمدة الى الموقع الجديد

Abdullatif [email protected]

Abdullatif [email protected]

Showing and hiding query fields إظهار و إخفاء حقول االستعالم

• By default, the check box in the Show row for each field in a query is selected. This means that the values in each field are displayed in the query’s results. By clearing this check box for a field, you remove that field’s values from the query’s result without removing the field from the query.

• The capability to hide a field is helpful when you want to use a field to define selection criteria or to sort a query but don’t want to show the field in the query’s results. Fields you use this way are essential to defining the query, but their values don’t need to be shown in the query’s results. You might add an ID field or a date field to a query for these purposes. For the ID field, you might specify a particular customer’s ID. You could use the date field to sort records to display orders sequentially since the start of your fiscal year. The purpose of these fields is to tailor the query. Any reporting or analysis doesn’t require that the query include the values that these fields provide.

حقل في افتراضيا، يتم تحديد خانة االختيار في مشاهدة صف لكل•

نتائج وهذا يعني أنه يتم عرض القيم في كل حقل في. االستعالم

، لهذا الحقلاالختيار بإزالة إشارة الصح من مربع . االستعالم

قل من نتيجة االستعالم دون إزالة الحالحقل هذا قيم يمكنك إزالة

.من االستعالم

حديد لتهذا الحقل حقل مفيدة عندما تريد استخدام الغاية من إخفاء •

نريد الاالستعالم بناء على هذا الحقل ولكن أو لفرز محددة معايير

ذه الطريقة الحقول التي تستخدم ه. الحقل في نتائج االستعالمظهار إ

ا في ضرورية لتحديد االستعالم، ولكن ال تحتاج قيمهم لعرضه

ي فحقل تاريخ حقل المعرف أو إضافة يمكن . نتائج االستعالم

. األغراضاالستعالم لهذه

. معينقد تحدد هوية عميل ،لحقل المعرف

ات الطلبياستخدام حقل التاريخ لفرز السجالت لعرض يمكن

هذه والغرض من. بالتتابع منذ بداية السنة المالية الخاصة بك

تطلب أي تحليل أو أي تقارير ال ت. هو لتكييف االستعالمالحقول

.الحقولهذه توفرها القيم التي تضمين االستعالم من

Abdullatif [email protected] To show and hide query fields

إلظهار و إخفاء حقول االستعالم

1. In the Navigation pane, right-click the query, and then click Design View.

ثم اضغط , كليك يمين على االستعالم, من نافذة جزء التنقل.عرض التصميمعلى

2. In the query design grid, clear the Show check box for any fields you want to hide.

ازل إشارة الصح من صندوق االختيار , من شبكة تصميم االستعالم

.ألي حقل تريد اخفائه

3. Select the Show check box to display a field in the results.

من اظهار ضع إشارة الصح في صندوق االختيار إلظهار الحقل في نتاج االستعالم

Abdullatif [email protected] Specifying the sort order for queries

تحديد الترتيب لالستعالمات• You use the Sort row in the query design grid to

specify how Access sorts the records returned by a query. You can sort by a single field or by more than one field. When you specify a sort order for more than one field, Access sorts records according to the order in which the fields appear left to right in the query design grid.

• If you want to sort by multiple fields in a particular sequence but also display one of these fields later in the order of the fields, add a second instance of the field, set the sort order for the field, and then clear the Show check box so that the second instance of the field doesn’t appear in the query’s results.

• To specify a sort order, click in the Sort row for a field, and then select the sort order you want to apply. The sorting options are Ascending, Descending, and Not Sorted. Be sure to reposition fields as you want them to appear when you are sorting records by more than one field.

عالم لتحديد في شبكة تصميم االستصف الترتيب يمكنك استخدام •

واسطة إرجاعها بيتم التي برنامج األكسيس يفرز السجالت كيف

. ديمكنك فرز حسب حقل واحد أو أكثر من حقل واح. االستعالم

لسجالت األكسيس يفرز اعند تحديد ترتيب ألكثر من حقل واحد،

مين في اليسار إلى اليالذي تظهر فيه الحقول من وفقا للترتيب

.شبكة تصميم االستعالم

كن أيضا متعددة في تسلسل معين ولترتيب لحقول إذا كنت تريد •

ل، في وقت الحق في ترتيب الحقوالحقول عرض واحد من هذه

م بإلغاء تحديد وتعيين ترتيب للحقل، ثم قمثيل ثاني للحقل، إضافة

ل في خانة االختيار إظهار بحيث ال يظهر المثيل الثاني من الحق

.نتائج االستعالم

م حدد ترتيب لتحديد ترتيب، انقر فوق في الصف ترتيب لحقل، ث•

ير ، تنازلي، وغالفرز تصاعديخيارات . الذي تريد تطبيقه

ند مما ال شك فيه أن يعيد الحقول كما تريد أن تظهر ع. مصنفة.فرز السجالت حسب أكثر من حقل واحد

Abdullatif [email protected] To use the Sort row in a query

الستخدام سطر الترتيب في االستعالمIn the query design grid, click in the Sort row for the field you want to sort by, and then select Ascending, Descending, or Not Sorted.

To sort by more than one field, specify the sort order for the additional fields. In the query design grid, arrange the fields from left to right in the order you want Access to use them to sort records.

حدد فرز لحقل, لفرز أكثر من حقل

, عالممن شبكة تصميم االست. إضافي

رتب الحقول من اليسار لليمين

الترتيب الذي تريده لألكسيس

.استخدامهم لفرز السجالت

, ممن شبكة تصميم االستعال

اضغط على سطر فرز للحقل

و , الذي تريد فرزه بواسطة

, تصاعدي, اختر نوع الفرز

.او غير مفروز, تنازلي

Abdullatif [email protected] Formatting fields in a query

تنسيق الحقول في االستعالم• At times, you might want to print the results of a query

or save the results as a PDF file for distribution. To enhance the plain display of the results in the datasheet, you can apply text formatting from the Home tab. For example, you can display or hide gridlines, apply a background color to alternate rows, and apply font attributes such as bold or italic.

• The text formatting you apply affects all the records in a query. You can’t, for example, apply bold formatting to only one column of values in the query’s datasheet. Even when you have a single column selected and click Bold in the Text Formatting group, the bold formatting is applied throughout the set of records. Perhaps the most useful text formatting tools are the options for adding or modifying alternate row colors and displaying gridlines to help distinguish the rows and columns of data.

• In a query, you can use a field’s Format property to display the values in that field differently from the way the field’s format is specified in the table in which the field is defined. For example, a date field can be defined with the Short Date format in its table but displayed in the Long Date format in a query. You can also use a field’s Caption property in a query to use a different label in the column heading. Setting the Format or Caption property for a field in a query does not define or change the property for the field in its table.

ج كملف في بعض األحيان، قد ترغب في طباعة نتائج استعالم أو حفظ النتائ•PDF يمكنك في ورقة البياناتالعرض العادي في نتائج لتعزيز . للتوزيع ،

سبيل المثال، على. تطبيق التنسيق من عالمة التبويب الصفحة الرئيسية النص

ف بديلة، يمكنك عرض أو إخفاء خطوط الشبكة، وتطبيق لون الخلفية إلى صفو

.وتطبيق سمات الخط مثل الغامق أو المائل

مكنك، على ال ي. تنسيق النص تطبيق يؤثر على جميع السجالت في االستعالم•

ي ورقة سبيل المثال، تطبيق التنسيق الغامق على عمود واحد فقط من القيم ف

لى محدد ونقرت عحتى عندما يكون لديك عمود واحد . البيانات في االستعالم

غامق في جميع في المجموعة تنسيق النص، يتم تطبيق التنسيق التنسيق الغامق

ات ولعل أدوات تنسيق النص األكثر فائدة هي خيار. السجالتأنحاء مجموعة

دة في وعرض خطوط الشبكة للمساعالبديلة إلضافة أو تعديل األلوان الصف

.تمييز الصفوف واألعمدة من البيانات

الحقل هذا لعرض القيم فيالحقل في استعالم، يمكنك استخدام خاصية تنسيق •

ريف تعتم في الجدول الذي طريقة تنسيق الحقل المحددة بشكل مختلف عن

يخ القصير على سبيل المثال، يمكن تعريف حقل تاريخ مع تنسيق التار. الحقل

ضا يمكنك أي. في الجدول ولكن عرضها في شكل تاريخ طويل في استعالم

خدام تسمية استخدام خاصية التسمية التوضيحية للحقل في االستعالم إلى است

ية للحقل وضع تنسيق أو خاصية التسمية التوضيح. مختلفة في عنوان العمود.بهاالستعالم ال تعريف أو تغيير الخاصية للحقل في الجدول الخاصفي

Abdullatif [email protected]

،عرض أو إخفاء خطوط الشبكة

،لون الخلفية إلى صفوف بديلةوتطبيق

,التسطيرالمائلسمات الخط مثل الغامق أو وتطبيق

.و تنسيق لون الخط و نوع الخط

هذه التنسيقات من عرض ورقة البيانات لالستعالم

Abdullatif [email protected]

To set formatting properties for a field in a query لتعيين خصائص التنسيقات للحقل في االستعالم

1. Open the query in Design view.

2. On the Query Tools Design tool tab, in the

Show/Hide group, click Property Sheet.

3. Click in the column for the field you want

to format.

4. In the property sheet, enter or select a value

for properties such as Format and Caption.

.افتح االستعالم في عرض التصميم1.

من تبويب أدوات التصميم في أدوات 2.

, من مجموعة اظهار و إخفاء, االستعالم

.اضغط على ورقة الخصائص

.قهاضغط على العمود للحقل الذي تريد تنسي3.

أدخل او اختر القيمة , من ورقة الخصائص4..للخصائص مثل التنسيق و التسمية

:متنسيقات الحقل في عرض التصمي

,وصف الحقل

,تنسيق الحقل

,قناع االدخال

.تسمية توضيحية للحقل