اذهب الي المحتوي
أوفيسنا

نجوم المشاركات

  1. ابو جودي

    ابو جودي

    أوفيسنا


    • نقاط

      7

    • Posts

      6,503


  2. محمد حسن المحمد

    • نقاط

      3

    • Posts

      2,212


  3. محمد هشام.

    محمد هشام.

    الخبراء


    • نقاط

      3

    • Posts

      1,056


  4. Foksh

    Foksh

    الخبراء


    • نقاط

      3

    • Posts

      1,596


Popular Content

Showing content with the highest reputation on 15 ينا, 2024 in all areas

  1. السلام عليكم ورحمة الله وبركاته ، أخواني وأساتذتي ومعلمينا ( دون استثناء ) اليوم جئتكم بفكرة جديدة وأعتقد أنه لم يسبقني أحد بهذا الطريق ؛ وهو إضافة اختيار واجهة اللغة إلى تطبيقات وبرامج ومشاريع الآكسيس بطريقة جديدة وتقدروا تقولوا 2024 في البداية سأقوم بشرح المطلوب داخل القاعدة التي سيتم التطبيق عليها ، أولاً :- جدول واحد فقط يحتوي على حقل واحد فقط أيضاً وسنسميه بـ SettingsTable ، والحقل الذي بداخله هو Language من نوع نصي ( Text ) . ثانياً :- نموذج Settings وهو طبعاً ليس له مصدر سجلات . وبداخله كومبوبوكس Combo box سيكون اسمه cboLanguage نوع مصدر بياناته Value List ؛ ومصدر بياناته القيم التالية ( "العربية";"English" ) . ثالثاً :- بجانب قاعدة البيانات سنقوم بإنشاء مجلد جديد وسيتم تسميته بـ Language . الآن خطوات العمل :- الموديول Module :- قم بإنشاء Module جديد وسمه بـ Set_Language ؛ وهو مفتاح العمل والذي من خلاله سنعتمد على جلب الترجمة من الملفات التي سنقوم بإنشائها لاحقاً . وهذا الكود مع الشرح الكامل له بين السطور . Option Compare Database Option Explicit ' المتغير العام لتخزين اللغة الحالية Public CurrentLanguage As String ' تحديث اللغة الحالية Public Sub UpdateLanguage() On Error Resume Next ' احصل على اللغة المحددة من جدول الإعدادات CurrentLanguage = DLookup("Language", "SettingsTable") ' قم بتحديث العلامات في جميع النماذج UpdateLabelsInAllForms End Sub ' تحديث العلامات في جميع النماذج Private Sub UpdateLabelsInAllForms() Dim frm As AccessObject ' تحديث العلامات في جميع النماذج المحملة For Each frm In CurrentProject.AllForms If frm.IsLoaded Then UpdateLabelsInForm Forms(frm.Name) End If Next frm End Sub ' تحديث العلامات في نموذج محدد Private Sub UpdateLabelsInForm(frm As Object) Dim arFile As String, enFile As String Dim arLabels() As String, enLabels() As String Dim i As Integer ' احصل على ملف اللغة العربية واللغة الإنجليزية arFile = GetLanguageFilePath("Arabic.txt") enFile = GetLanguageFilePath("English.txt") ' اقرأ الملفات واملأ المصفوفات بالنصوص المترجمة arLabels = Split(ReadFile(arFile), vbCrLf, -1) enLabels = Split(ReadFile(enFile), vbCrLf, -1) ' قم بتحديث العلامات في النموذج For i = 0 To UBound(arLabels) UpdateLabel frm, "Label" & CStr(i + 1), arLabels(i), enLabels(i) UpdateLabel frm, "Command" & CStr(i + 1), arLabels(i), enLabels(i) Next i End Sub ' احصل على مسار قاعدة البيانات الحالية Private Function GetDatabasePath() As String Dim dbPath As String dbPath = CurrentDb.Name GetDatabasePath = Left(dbPath, InStrRev(dbPath, "\")) End Function ' احصل على مسار ملف اللغة Private Function GetLanguageFilePath(fileName As String) As String GetLanguageFilePath = GetDatabasePath() & "Language\" & fileName End Function ' اقرأ ملف النص وارجع النص كنص نصي Private Function ReadFile(filePath As String) As String Dim fileNumber As Integer fileNumber = FreeFile Open filePath For Input As fileNumber ReadFile = Input$(LOF(fileNumber), fileNumber) Close fileNumber End Function ' تحديث علامة محددة في النموذج بناءً على اللغة الحالية Private Sub UpdateLabel(frm As Object, labelName As String, arabicText As String, englishText As String) On Error Resume Next ' قم بتحديث العلامة بناءً على اللغة الحالية frm.Controls(labelName).Caption = IIf(CurrentLanguage = "العربية", arabicText, englishText) On Error GoTo 0 End Sub * ملاحظة :- سنعتمد هنا على طريق بسيط جداً وهو المسميات في النماذج ، فمثلاً لو انشأنا زر في نموذج ما وكانت تسميته Caption هي حفظ وكان اسم الزر Command1 ؛ فعند الترجمة سيصبح كل زر في البرنامج باسم Command1 هو بمثابة زر الحفظ وستكون ترجمته Save ؛ لذا سنعتمد طريقة توحيد المسميات في النماذج وهذا سيجعل الأمر سهلاً جداً للصيانة ، وطبعاً لا يمكن أن يكون لعنصرين ( كائنين ) في النموذج لهما نفس الإسم . رابعاً :- العودة إلى نموذج Settings الذي تم التحدث عنه في النقطة ( ثانياً ) ؛ سنقوم بدايةً باستكمال إنشاء الأكواد الخاصة بتغيير اللغة ، قبل الأحداث للـ Combo Box والنموذج . سنقوم بإدراج هذه الأكواد الثلاثة البسيطة :- ' تحديث العناصر في النموذج بناءً على اللغة المختارة Private Sub UpdateLanguageForControls() On Error Resume Next Dim ctrl As AccessObject For Each ctrl In Me.Controls ' يمكنك هنا إضافة العناصر الأخرى التي تريد تحديثها بناءً على اللغة ' مثلا: If TypeOf ctrl Is ComboBox Then Next ctrl End Sub ' حفظ اختيار اللغة في جدول SettingsTable Private Sub SaveLanguageChoice() CurrentDb.Execute "UPDATE SettingsTable SET Language='" & Me.cboLanguage & "'" End Sub ' تغيير اللغة وتحديث العناصر ذات الصلة Private Sub ChangeLanguage(selectedLanguage As String) CurrentDb.Execute "UPDATE SettingsTable SET Language='" & selectedLanguage & "'" UpdateLanguageForControls End Sub وفي حدث عند الفتح للنموذج سنقوم بإدراج هذا الكود :- ' حدث يتم تنفيذه عند فتح النموذج Private Sub Form_Open(Cancel As Integer) UpdateLanguage End Sub وفي حدث عند التحديث للكومبوبوكس سندرج الكود التالي :- ' حدث يتم تنفيذه بعد تحديث اختيار اللغة من ComboBox Private Sub cboLanguage_AfterUpdate() Dim response As VbMsgBoxResult Dim Language As String ' احصل على اللغة المحددة من ComboBox Language = Me.cboLanguage.Value ' قم بتحديد الرسالة بناءً على اللغة المختارة If Language = "العربية" Then response = MsgBox("هل ترغب في تغيير اللغة إلى العربية؟", vbQuestion + vbYesNo, "التأكيد") ElseIf Language = "English" Then response = MsgBox("Do you want to change the language to English?", vbQuestion + vbYesNo, "Confirmation") End If ' قم باتخاذ الإجراء المناسب بناءً على رد المستخدم If response = vbYes Then SaveLanguageChoice Application.Quit Else SaveLanguageChoice DoCmd.Close End If End Sub الآن نأتي لأهم نقطة في هذا الموضوع ، ألا وهي . أين ستكون الترجمة ؟ طبعاً قمنا سابقاً بإنشاء المجلد Language بجانب قاعدة البيانات ، الآن سنذهب إليه وسنقوم بإنشاء ملفين نصيين Text الأول Arabic.txt ، والثاني English.txt . في الأعلى افترضنا انه لدينا في النموذج زر اسمه Command1 والـ Caption له كانت حفظ ، الآن سنقوم بكتابة المسمى بالعربي وهو حفظ في ملف النص Arabic ، وفي الملف الثاني English سنكتب Save وهو أول أمر قمنا به كتجربة ( لاحظ أن Command يتبعها الرقم 1 ) وعليه فأن أي مسمى Command1 في أي نموذج سيكون اسمه حفظ أو Save عند اختيار الإنجليزية . وفي النهاية سأترك مرفق يحتوي تطبيق لما تحدثنا به سابقاً . والمتابعة لأي استفسار أو توضيح Change Language.zip
    2 points
  2. جزاك الله خير وبارك الله فيك والشكر لطاقم هذا الموقع المفيد جدا اخي محمد المحمد لك كل الشكر والامتنان
    2 points
  3. لتصميم الشاشة الرئيسية وسهولة التحكم فىيها تم اضافة جدول جديد باسم tblFormsTitle يتكون من الحقول FormName = اسم النموذج الفرعى FormDesc = وصف النموذج ( معيار احضار بيانات اسم النموذج والعنوان فى الكود) TitleForm = العنوان فى الشاشة الرئيسية البيانات داخل الجدول كالاتى اسم النموذج الفرعى وصف النموذج ( معيار احضار بيانات اسم النموذج والعنوان فى الكود) العنوان فى الشاشة الرئيسية frmHomeMenu HomeMenu الرئيسية frmSub1ImportOraclExcel ImportExcel استيراد بيانات الحضور والانصراف ( Oracle's Excel sheet ) frmSub2DailyEmployee DailyEmployee ادارة يوميات الموظفين ( اضافة / تعديل / حذف ) frmSub3QueryDaily QueryDailyBy استعلام وتقارير يوميات الموظفين frmSub4Employees EmployeesData ادارة بيانات الموظفين ( اضافة / تعديل / حذف ) frmSub5DailyLogsType DailyLogsType ادارة انواع اليوميات ( اضافة / تعديل / حذف ) frmSub6Department Department ادارة بيانات الادارات و المديرين ( اضافة / تعديل / حذف ) frmSub7Section Section ادارة بيانات الاقسام ( اضافة / تعديل / حذف ) تم تصميم النماذج الفرعية بدون اى مصدر بيانات .... عمل نموذج رئيسي باسم frmMain فى وضع التصميم تم اضافة نموذج فرعى غير منضم باسم subformControl تم اضافة مربع تسمية ( Lable ) باسم lblTitle اضافة عدد سبع ازرار باسماء btnNavItem1 ,btnNavItem2 , btnNavItem3 , ........ الخ عنصر تحكم صورة باسم imgArrow يحتوى على شكل سهم الاكواد فى النموذج قائمة بوظائف الازرار تبعا لوصف النماذج من الجدول والذى اشرنا الى الحقل الخاص به وصف النموذج ( معيار احضار بيانات اسم النموذج والعنوان فى الكود) ' Enum to define button actions Enum ButtonAction HomeMenu ImportExcel DailyEmployee QueryDailyBy EmployeesData DailyLogsType Department Section End Enum متغيرات لاسناد قيم اليها ' Declare variables to store form name and title Private strFormName As String Private strTitleForm As String Private subformInfoArray As Variant دالة لتحديد المعيار لجلب البيانات للنماذج الفرعية من الجدول ( اسم النموذج - العنوان فى الشاشة الرئيسية ) بناء على Enum قائمة الازرار ' Sub to handle button click events Private Sub HandleButtonClick(btnAction As ButtonAction) Dim subformInfoResult As String ' Get subform information based on the button action subformInfoResult = GetSubformInfo(ButtonActionToString(btnAction)) ' Process the subform information and update the form ProcessSubformInfo subformInfoResult End Sub دالة لاحضار معلومات النماذج الفرعية من الجدول ( اسم النموذج - العنوان فى الشاشة الرئيسية ) بناء على المعيار من الدالة السابقة ' Function to get the name and title of the subform based on the form description Function GetSubformInfo(subformDesc As String) As String ' Use On Error Resume Next to handle errors gracefully On Error Resume Next ' Declare a DAO Recordset variable Dim rs As DAO.Recordset ' Open a recordset based on the provided form description Set rs = CurrentDb.OpenRecordset("SELECT FormName, TitleForm FROM tblFormsTitle WHERE FormDesc='" & subformDesc & "'") ' Check if the recordset is not empty If Not rs.EOF Then ' Return the concatenated string of FormName and TitleForm GetSubformInfo = rs!formName & "," & rs!titleForm Else ' Return an empty string if no matching record is found GetSubformInfo = "" End If ' Close the recordset to free up resources rs.Close Set rs = Nothing ' Check for errors and display debug information If Err.Number <> 0 Then MsgBox "Error retrieving subform information: " & Err.Description, vbExclamation Err.Clear End If End Function دالة لفصل اسم النموذج والعنوان والذى تم الحصول عليهم من الدالة السابقة ' Sub to process subform information and update the form Sub ProcessSubformInfo(subformInfoResult As String) ' Split the subformInfo into an array subformInfoArray = Split(subformInfoResult, ",") ' Extract the formName and title from the array If UBound(subformInfoArray) >= 1 Then strFormName = Trim(subformInfoArray(0)) strTitleForm = subformInfoArray(1) End If ' Update the form based on the subform information UpdateFormBasedOnSubformInfo End Sub دالة للتحكم فى اظهار واخفاء موضع صورة سهم تدل على النموذج الفرعى تبعا لزر الامر ' Sub to move the arrow indicator on the form Sub MoveArrow() ' Make the arrow visible and position it below the active control If Not Me.imgArrow.Visible Then Me.imgArrow.Visible = True Me.imgArrow.Top = Me.ActiveControl.Top ChangeCommandButtonColor Me End Sub دالة تحديث النموذج بناء على المعطيات السابقة من الدوال بمجرد النقر على زر الامر ' Sub to update the form based on the subform information Sub UpdateFormBasedOnSubformInfo() Select Case Nz(strFormName, "frmHomeMenu") Case Is = "frmHomeMenu" Me.lblTitle.Caption = strTitleForm subformControl.Visible = False ChangeCommandButtonColor Me, False Me.imgArrow.Visible = False Me.subformControl.SourceObject = "" Me.subformControl.Height = 0 Case Else Me.lblTitle.Caption = strTitleForm MoveArrow ChangeCommandButtonColor Me Me.subformControl.Height = BoxMain.Height Me.subformControl.SourceObject = strFormName subformControl.Visible = True End Select End Sub الاكواد لضبط وتحديد الحدث المراد تنفيذه تبعا لازرار الاوامر ' Function to convert ButtonAction to corresponding form description Function ButtonActionToString(btnAction As ButtonAction) As String Select Case btnAction Case ButtonAction.HomeMenu: ButtonActionToString = "HomeMenu" Case ButtonAction.ImportExcel: ButtonActionToString = "ImportExcel" Case ButtonAction.DailyEmployee: ButtonActionToString = "DailyEmployee" Case ButtonAction.QueryDailyBy: ButtonActionToString = "QueryDailyBy" Case ButtonAction.EmployeesData: ButtonActionToString = "EmployeesData" Case ButtonAction.DailyLogsType: ButtonActionToString = "DailyLogsType" Case ButtonAction.Department: ButtonActionToString = "Department" Case ButtonAction.Section: ButtonActionToString = "Section" End Select End Function الاكواد على ازرار الاوامر Private Sub ImageLogo_Click() HandleButtonClick HomeMenu End Sub Private Sub btnNavItem1_Click() HandleButtonClick ImportExcel End Sub Private Sub btnNavItem2_Click() HandleButtonClick DailyEmployee End Sub Private Sub btnNavItem3_Click() HandleButtonClick QueryDailyBy End Sub Private Sub btnNavItem4_Click() HandleButtonClick EmployeesData End Sub Private Sub btnNavItem5_Click() HandleButtonClick DailyLogsType End Sub Private Sub btnNavItem6_Click() HandleButtonClick Department End Sub Private Sub btnNavItem7_Click() HandleButtonClick Section End Sub واخيرا وحدة نمطية باسم basChangeButtonColor خاصة بتغير لون زر الامر الذى يتم الضغط عليه فى النموذج الرئيسى ' Enum for colors Enum ColorEnum WhiteColor = 16777215 ' White RedColor = 255 ' Red GreenColor = 32768 ' Green BlueColor = 16711680 ' Blue PurpleColor = 8388736 ' Purple GrayColor = 8421504 ' Gray OrangeColor = 16753920 ' Orange BrownColor = 10824234 ' Brown BlackColor = 0 ' Black CyanColor = 16776960 ' Cyan MagentaColor = 16711935 ' Magenta YellowColor = 65535 ' Yellow LightBlueColor = 173216230 ' Light Blue DarkGreenColor = 65280 ' Dark Green PinkColor = 16761035 ' Pink LavenderColor = 230230250 ' Lavender OliveColor = 32896 ' Olive AquaColor = 65535 ' Aqua TurquoiseColor = 4251856 ' Turquoise GoldColor = 16766720 ' Gold SilverColor = 12632256 ' Silver MaroonColor = 8388608 ' Maroon NavyColor = 128 ' Navy TealColor = 8421376 ' Teal CoralColor = 5275647 ' Coral SalmonColor = 16416882 ' Salmon IndigoColor = 4915330 ' Indigo PeachColor = 16775640 ' Peach SiennaColor = 10506797 ' Sienna SkyBlueColor = 8900331 ' Sky Blue End Enum ' Module-level variables Dim currentButtonBackColor As Long ' Variable to store the current button back color Dim currentButtonForeColor As Long ' Variable to store the current button fore color Dim selectedButton As CommandButton ' Variable to store the selected button ' Subroutine to set the button color Sub SetButtonColor(ByVal frm As Form, Optional btn As CommandButton = Nothing) ' Set new button colors Dim newButtonBackColor As Long Dim newButtonForeColor As Long newButtonBackColor = ColorEnum.GrayColor newButtonForeColor = ColorEnum.BlackColor If Not btn Is Nothing Then ' Store the current button's colors currentButtonBackColor = btn.BackColor currentButtonForeColor = btn.ForeColor ' Clear the previous button's highlight If Not selectedButton Is Nothing Then selectedButton.BackColor = currentButtonBackColor selectedButton.ForeColor = currentButtonForeColor End If ' Set the new button as selected and highlight it Set selectedButton = btn btn.BackColor = newButtonBackColor btn.ForeColor = newButtonForeColor End If End Sub ' Subroutine to change the button color Sub ChangeCommandButtonColor(frm As Form, Optional changeColor As Boolean = True) On Error GoTo ErrorHandler Dim clickedButton As CommandButton Set clickedButton = frm.ActiveControl ' Store the default button colors before changing Dim currentButtonBackColor As Long Dim currentButtonForeColor As Long currentButtonBackColor = clickedButton.BackColor currentButtonForeColor = clickedButton.ForeColor ' Clear the previous button's highlight If Not selectedButton Is Nothing Then selectedButton.BackColor = currentButtonBackColor selectedButton.ForeColor = currentButtonForeColor End If ' Set the new button as selected and highlight it Set selectedButton = clickedButton ' Apply the button color if changeColor is True If changeColor Then SetButtonColor frm, clickedButton End If Err.Clear ' Clear Err Exit Sub ' Exit to avoid handler. ErrorHandler: ' Error-handling routine. Select Case Err.Number ' Evaluate error number. Case Is = 5 Resume Next Exit Sub ' Exit to avoid handler. Case Else ' Handle other situations here... MsgBox "Error: " & Err.Number & vbCrLf & "Description: " & Err.Description Resume ' Resume execution at the same line End Select End Sub المميزات : 1- عند الابتعاد عن الشاشة والعودة مرة أخرى بمجرد النظر يمكنك معرفة الزر الاخير الذى تم الضغط عليه 2-سهولة تغيير العناوين التى تظهر على الشاشة الرئيسية تبعا لكل نموذج فرعى بكل سهولة بدون داعى للدخول الى عرض التصميم من الجدول اختبار تجربة يتبع ... واخيرا المرفق HRManagement V 1.0.2.zip
    2 points
  4. البيانات الرئيسية والتى نريد تحضيرها مرة واحدة فقط عند بدء التطيق لنتمكن من استخدامها فى زوايا التطبيق المختلفة على سبيل المثال وليس الحصر نريد اسم الشركة دائما فى كل التقارير مثلا عند تحقق شرط معين بيانات الاتصال بالمصمم لعمل ذلك نقوم ببناء جدول ليكون اسمه tblGlobalInformation بناء الجدول يعتمد على حقلين itemName , itemValue والان وحدة نمطية جديدة ليكون اسمها = basGlobalInformation فى الوحدة النمطية نقوم بعمل Enumeration هي كلاسات خاصة تستخدم لتعريف ثوابت محددة مسبقا وتستخدم لتخزين عناصر متتالية دفعة واحدة بعدها يمكنه إرجاع هذه العناصر واحدا تلو الآخر حسب الحاجة الاكواد داخل الوحدة النمطية basGlobalInformation Option Compare Database Option Explicit ' Enumeration defining global information indices Public Enum EnumInformation EnumStartIndex ' Enumeration values for global information start infSoftwarName infSoftwarVersion infDesignCompany infDesigerName infDesigerMail infDesigerPhone infCompanyName infCompanyGM EnumEndIndex = infCompanyGM ' Enumeration value for global information end End Enum ' Array to store global information values Public Ginf() As String ' Public variables to store individual global information values Public GetSoftwarName As String Public GetSoftwarVersion As String Public GetDesignCompany As String Public GetDesigerName As String Public GetDesigerMail As String Public GetDesigerPhone As String Public GetCompanyName As String Public GetCompanyGM As String ' The name of the table Global Information Public Const TableGlobalInformationName As String = "tblGlobalInformation" Function IsArrayInitialized(arr As Variant) As Boolean ' Check if the array is initialized (not empty or uninitialized) On Error Resume Next IsArrayInitialized = (UBound(arr) >= LBound(arr)) On Error GoTo 0 End Function Public Sub SetGlobalVariables() ' Procedure to set global variables based on database values On Error Resume Next ' Open a recordset based on the SQL query Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String Set db = CurrentDb ' Check if the table exists in the database If Not IsTableExists(TableGlobalInformationName, db) Then Exit Sub ' Check if global information values are already populated If Not IsArrayInitialized(Ginf) Then ' Resize the global information values array based on the count of enumeration items ReDim Ginf(1 To EnumEndIndex - EnumStartIndex) As String ' Create a SQL query to retrieve all required items in one go strSQL = "SELECT itemName, itemValue FROM " & TableGlobalInformationName & " WHERE itemName " & _ "IN ('SoftwarName', 'SoftwarVersion', 'DesignCompany', 'DesigerName', " & _ "'DesigerMail', 'DesigerPhone', 'CompanyName', 'CompanyGM');" ' Open a recordset based on the SQL query Set rs = db.OpenRecordset(strSQL) ' Loop through the recordset and assign values to global information values array Do While Not rs.EOF Dim itemName As String itemName = rs.Fields("itemName").Value Dim itemIndex As Integer itemIndex = GetInfoIndex(itemName) If itemIndex <> -1 Then Ginf(itemIndex) = rs.Fields("itemValue").Value Else Debug.Print "ItemName: " & itemName & " not found in EnumInf." End If rs.MoveNext Loop ' Assign individual global information values to public variables GetSoftwarName = Ginf(EnumInformation.infSoftwarName) GetSoftwarVersion = Ginf(EnumInformation.infSoftwarVersion) GetDesignCompany = Ginf(EnumInformation.infDesignCompany) GetDesigerName = Ginf(EnumInformation.infDesigerName) GetDesigerMail = Ginf(EnumInformation.infDesigerMail) GetDesigerPhone = Ginf(EnumInformation.infDesigerPhone) GetCompanyName = Ginf(EnumInformation.infCompanyName) GetCompanyGM = Ginf(EnumInformation.infCompanyGM) ' Close the recordset rs.Close Set rs = Nothing End If ' Handle errors If Err.Number <> 0 Then ' Handle error If Err.Number = 94 Then Exit Sub ' Handle the error (display a message) Call ErrorLog(Err, Error$, "basEnumInformationrmation : SetGlobalVariables") Err.Clear End If On Error GoTo 0 End Sub Function GetInfoIndex(itemName As String) As Integer ' Helper function to get the index of an item in the EnumInformation enumeration Select Case itemName Case "SoftwarName" GetInfoIndex = EnumInformation.infSoftwarName Case "SoftwarVersion" GetInfoIndex = EnumInformation.infSoftwarVersion Case "DesignCompany" GetInfoIndex = EnumInformation.infDesignCompany Case "DesigerName" GetInfoIndex = EnumInformation.infDesigerName Case "DesigerMail" GetInfoIndex = EnumInformation.infDesigerMail Case "DesigerPhone" GetInfoIndex = EnumInformation.infDesigerPhone Case "CompanyName" GetInfoIndex = EnumInformation.infCompanyName Case "CompanyGM" GetInfoIndex = EnumInformation.infCompanyGM End Select End Function طيب بما اننا نتكلم عن اعدادات مهمة لابد من تحقيقها عند بدء التطبيق سوف نقوم بعمل وحدة نمطية باسم basInitialization ونضع بها الاكواد الاتية Rem Subroutine to initialize the application Sub InitializeApplication() Rem Initialize the error log table if it doesn't exist If Not IsErrorLogTableInitialized() Then CreateErrorLogTable Rem Call the function to set global variables. SetGlobalVariables End Sub ونقوم بعمل نموذج البدء ليكون اسمه frmInitialization فى هذا النموذج نستدعى الدالة السابقة فى حدث عند تحميل النموذج بالشكل التالى Private Sub Form_Load() On Error Resume Next Rem Set the initial time as the interval for the timer Rem Initialize the application when the startup form is loaded. InitializeApplication Rem Add calls to the initialized special functions through which you want the database to be booted Rem Or add specify the codes through which you would like to process the data later according to the requirements of your design Rem Set the current procedure name (you can adjust the procedure name as needed) If Err.Number <> 0 Then Rem Clear the error Err.Clear End If End Sub يتبع ... واخيرا المرفق HRManagement V 1.0.0.accdb
    2 points
  5. السلام عليكم ورحمة الله اخوانى الافاضل كل عام وانتم بخير احتاج مساعدة بكود Vba للتجميع بدون تكرار لدينا شيتان الاول به ثلاث اعمدة الاسم والرقم القومى والمبلغ والشيت الثانى اسمه تجميع بدون تكرار احتاج كود للبحث فى عمود الرقم القومى اذا كان مكرر يجمع المبلغ بارك الله فيكم اخوانى الافاضل كود تجميع .xlsx
    1 point
  6. 1 point
  7. مشاركة بسيطة كثير من المستخدمين لا يحبذوا استخدام قناع الادخال وكذلك اخونا الفاضل شايب يتجنب ذلك لذا ممكن وضع الامر التالي في حدث بعد التحديث للحقل المطلوب او اي حدث زر حفظ او ... If (Not IsNumeric([الحقل]) Or Len([الحقل]) <> 12) Then MsgBox "هذا الحقل يقبل ارقام بعدد 12 رقم" Me.Undo End If وهنا نضع شرط اذا كان الادخال ليس ارقام او ان عدد الارقام لا يساوي 12 اخرج الرسالة الشايب لم انتبه الى تاريخ المشاركة اعتذر من الجميع
    1 point
  8. وعليكم السلام ورحمة الله تعالى وبركاته بعد ادن الاستاد المحترم @محمد حسن المحمد تفضل جرب اخي Sub Total_amount() Dim WS As Worksheet, Dest As Worksheet: Set WS = Sheets("Sheet1"): Set Dest = Sheets("التجميع بدون تكرار") a = WS.Range("B1").CurrentRegion.Value Dim c() ReDim c(1 To UBound(a, 1), 1 To UBound(a, 2)) Cpt = 1 Set mondico = CreateObject("Scripting.Dictionary") Application.ScreenUpdating = False For i = 1 To UBound(a) temp = a(i, 1) & a(i, 2) If Not mondico.exists(temp) Then mondico.Add temp, "" For k = 1 To UBound(a, 2) - 1: c(Cpt, k) = a(i, k): Next k c(Cpt, k) = c(Cpt, k) + a(i, k) Cpt = Cpt + 1 Else j = Application.Match(temp, mondico.keys, 0) col = UBound(a, 2) c(j, col) = c(j, col) + a(i, col) End If Dest.[B1:D1000] = Empty Next Dest.[B1].Resize(mondico.Count, UBound(a, 2)) = c End Sub كود تجميع .xlsb
    1 point
  9. خالص الشكر استاذ محمد حسن المحمد اعزك الله احتاج كود لتنفيذ نظرا لكبر حجم الداتا بارك الله فيك واعزك اللهم امين يارب العالمين
    1 point
  10. وعليكم السلام هذا حل بالمعادلات إن كان يناسبك أخي الكريم كود تجميع .xlsx
    1 point
  11. ارسل فقط الجدول أو جزء منه .
    1 point
  12. الحمد لله الذي بنعمته تتم الصالحات وجزاكم بمثل ما دعوتم ... آمين لا شكر على واجب ....بارك الله بكم أخي الكريم.... حياكم الله وبياكم. والسلام عليكم
    1 point
  13. ما شاء الله مجهود كبير 🤲 ربنا يجعله فى ميزان حسناتك 🤲 تسلم ايدك
    1 point
  14. تفضل أستاذ @ابو هاله النبلسي محاولتي حسب مافهمت . توحيد بيانات فيها تشابه جزئي.rar
    1 point
  15. يسعدني ويشرفني مرورك العطر 🥰
    1 point
  16. قم باستبدال If TblInv(i, 1) = CB_Pièce Then الى If TblInv(i, 1) = CB_Pièce.Text Then
    1 point
  17. عمل راااائع ما شاء الله تبارك الرحمن أخي @Foksh عندي سؤال : لماذا لم تحفظ الترجمة في جدول بالبرنامج بدل حفظها في ملفات خارجية ؟ 🙂 ثانيا : أضفت لمسة للبرنامج وهي أنه يقوم بإعادة تشغيل البرنامج تلقائيا بعد اختيار اللغة المطلوبة 🙂 وذلك باستخدام هذا الكود : Sub RestartAccess() Dim vbsFilePath As String vbsFilePath = CurrentProject.Path & "\Restart.vbs" ' Change the file path as needed Dim vbsContent As String vbsContent = "WScript.Sleep(2000)" & vbCrLf & _ "CreateObject(""Shell.Application"").Namespace(0).ParseName(""" & CurrentProject.FullName & """).InvokeVerb ""Open""" ' Create the VBS file and write the content Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") Dim vbsFile As Object Set vbsFile = fso.CreateTextFile(vbsFilePath, True, False) vbsFile.Write vbsContent vbsFile.Close ' Shell execute the VBS file to restart Access Shell "wscript.exe """ & vbsFilePath & """", vbNormalFocus ' Exit Access Application.Quit End Sub Change Language.zip
    1 point
  18. وعليكم السلام تفضل أخي الكريم: Book1.xlsx
    1 point
  19. اخي ربما يتعين عليك وضع حماية لورقة العمل لديك لمنع اظهار الاعمدة او اخفائها بدون ادخال كلمة المرور جرب هدا الملف باسوورد 1234 إخفاء اعمدة وصفوف برقم سري.xlsb
    1 point
  20. لا شكر على واجب اهلا بك جزانا والله واياكم خير الجزاء وسعيد جدا والله الحمد انا فى حد بتعجبة شخابيطى وعلشان بتحب الشخبطة خد اخر شخابيطى توسيط واخفاء بطريقة جديدة HideAccess.accdb
    1 point
  21. الان الجداول الاساسية المرفق بالجداول اللازمة HR Managment.zip
    1 point
  22. السلام عليكم ورحمة الله وبركاته 🌹 درسنا اليوم عن طريقة عمل قوائم ديناميكية متحركة بأقل عدد من الأكواد وطريقة مبتكرة . 🙂 النتيجة النهائية : الشرح : تحميل الملف : Dynamic Menus.accdb
    1 point
  23. السلام عليكم ورحمة الله تعالى وبركاته تحية طيبة عطرة موديول واحد قمت بتجميع الدوال الهامة للتاريخ بحيث يسهل استخدامها مع الاخذ فى الاعتبار بمرونة التحكم الشامل فى كل كبيرة وصغيره بسم الله الرحمن الرحيم وعلى بركة الله طالما سوف نتطرق الى التاريخ والتعامل معه لابد أن نبدأ على خطى استاذى الجليل و معلمى القدير و والدى الحبيب الاستاذ @jjafferr واقتبس من استاذى الجليل تلك الكلمات التى لابد ان تعلق فى اذهان كل من يتعامل مع دوال والتاريخ الروتين رقم 1 DateFormat Function DateFormat(ByVal varDate As Variant) As String 'Purpose: Return a delimited string in the date format used natively by JET SQL. 'Argument: A date/time value. 'Note: Returns just the date format if the argument has no time component, ' or a date/time format if it does. 'Author: Allen Browne. allen@allenbrowne.com, June 2006. ' 'calling the Function: DateFormat(The_Date_Field) 'a = dlookup("[some field]","some table","[id]=" & me.id & " And [Date_Field]=" & DateFormat(The_Date_Field)) ' If IsDate(varDate) Then If DateValue(varDate) = varDate Then DateFormat = Format$(varDate, "\#mm\/dd\/yyyy\#") Else DateFormat = Format$(varDate, "\#mm\/dd\/yyyy hh\:nn\:ss\#") End If End If End Function الروتين رقم 2 ToWhat يقوم بعمل التحويل من التاريخ الميلادى الى الهجرى والعكس ولكن لابد من عمل جدول باسم tblAdjustHjriDate يحتوى على حقل رقمى باسم AdjustDay وذلك لوضع الفرق بالايام بين التاريخين حسب كل شهر للحصول على النتيجة الصحيحة ' ______ ______ .__ __. ____ ____ _______ .______ .___________. __ .__ __. _______ ' / | / __ \ | \ | | \ \ / / | ____|| _ \ | || | | \ | | / _____| ' | ,----'| | | | | \| | \ \/ / | |__ | |_) | `---| |----`| | | \| | | | __ ' | | | | | | | . ` | \ / | __| | / | | | | | . ` | | | |_ | ' | `----.| `--' | | |\ | \ / | |____ | |\ \----. | | | | | |\ | | |__| | ' \______| \______/ |__| \__| \__/ |_______|| _| `._____| |__| |__| |__| \__| \______| ' _______ ___ .___________. _______ _______ .______ ______ .___ ___. ' | \ / \ | || ____| | ____|| _ \ / __ \ | \/ | ' | .--. | / ^ \ `---| |----`| |__ | |__ | |_) | | | | | | \ / | ' | | | | / /_\ \ | | | __| | __| | / | | | | | |\/| | ' | '--' | / _____ \ | | | |____ | | | |\ \----.| `--' | | | | | ' |_______/ /__/ \__\ |__| |_______| |__| | _| `._____| \______/ |__| |__| ' _______ .______ _______ _______ ______ .______ __ ___ .__ __. .___________. ______ ' / _____|| _ \ | ____| / _____| / __ \ | _ \ | | / \ | \ | | | | / __ \ ' | | __ | |_) | | |__ | | __ | | | | | |_) | | | / ^ \ | \| | `---| |----`| | | | ' | | |_ | | / | __| | | |_ | | | | | | / | | / /_\ \ | . ` | | | | | | | ' | |__| | | |\ \----.| |____ | |__| | | `--' | | |\ \----.| | / _____ \ | |\ | | | | `--' | ' \______| | _| `._____||_______| \______| \______/ | _| `._____||__| /__/ \__\ |__| \__| |__| \______/ ' __ __ __ __ .______ __ ' | | | | | | | | | _ \ | | ' | |__| | | | | | | |_) | | | ' | __ | | | .--. | | | / | | ' | | | | | | | `--' | | |\ \----.| | ' |__| |__| |__| \______/ | _| `._____||__| ' ______ .______ .______ ___ ______ __ ___ ' / __ \ | _ \ | _ \ / \ / || |/ / ' | | | | | |_) | | |_) | / ^ \ | ,----'| ' / ' | | | | | / | _ < / /_\ \ | | | < ' | `--' | | |\ \----. | |_) | / _____ \ | `----.| . \ ' \______/ | _| `._____| |______/ /__/ \__\ \______||__|\__\ ' Public Function ToWhat(ByRef myData As String, To_Hijri_Milady As String) As String Dim CorctAdjustDay As Integer Dim SavedCal As Integer Dim strD As Date Dim strS As String On Error GoTo ErrorHandler 'to call the Function 'Hijri to Milady 'txt Milady date = ToWhat(txt Hijri date, "H") 'Milady to Hijri 'txt Hijri date = ToWhat(txt Milady date, "M") CorctAdjustDay = DLookup("[AdjustDay]", "tblAdjustHjriDate") If To_Hijri_Milady = "M" Then myData = Trim(Format(DateAdd("d", -1 * CorctAdjustDay, myData), "dd/mm/yyyy")) SavedCal = Calendar VBA.Calendar = 1 strD = CDate(myData) VBA.Calendar = 0 Else myData = Trim(Format(DateAdd("d", CorctAdjustDay, myData), "dd/mm/yyyy")) SavedCal = Calendar VBA.Calendar = 0 strD = CDate(myData) VBA.Calendar = 1 End If strS = CStr(strD) ToWhat = Format(strS, "dd/mm/yyyy") VBA.Calendar = SavedCal ErrorHandlerExit: Exit Function ErrorHandler: If Err = 13 Then MsgBox "Wrong Data", vbOKOnly + vbMsgBoxRight + vbMsgBoxRtlReading, "Wrong" Exit Function 'Resume Next Else Resume ErrorHandlerExit End If End Function الروتين رقم 3 MyNo للتحكم فى شكل ظهور الارقام بالعربية او بالهندية من خلال استخدام اليونيكود ' __ ___ .__ __. _______ __ __ ___ _______ _______ ______ _______ .__ __. __ __ .___ ___. .______ _______ .______ _______. ' | | / \ | \ | | / _____|| | | | / \ / _____|| ____| / __ \ | ____| | \ | | | | | | | \/ | | _ \ | ____|| _ \ / | ' | | / ^ \ | \| | | | __ | | | | / ^ \ | | __ | |__ | | | | | |__ | \| | | | | | | \ / | | |_) | | |__ | |_) | | (----` ' | | / /_\ \ | . ` | | | |_ | | | | | / /_\ \ | | |_ | | __| | | | | | __| | . ` | | | | | | |\/| | | _ < | __| | / \ \ ' | `----. / _____ \ | |\ | | |__| | | `--' | / _____ \ | |__| | | |____ | `--' | | | | |\ | | `--' | | | | | | |_) | | |____ | |\ \----..----) | ' |_______|/__/ \__\ |__| \__| \______| \______/ /__/ \__\ \______| |_______| \______/ |__| |__| \__| \______/ |__| |__| |______/ |_______|| _| `._____||_______/ ' Public Function MyNo(ByVal strNo As String, ByVal strLng As String) 'to call the Function 'To Arabic 'txtNoToAR=MyNo(txtNo,"Ar") 'To English 'txtNoTOEng=MyNo(txtNo,"En") If strLng = "Ar" Then strNo = Replace(strNo, ChrW(48), ChrW(1632)) strNo = Replace(strNo, ChrW(49), ChrW(1633)) strNo = Replace(strNo, ChrW(50), ChrW(1634)) strNo = Replace(strNo, ChrW(51), ChrW(1635)) strNo = Replace(strNo, ChrW(52), ChrW(1636)) strNo = Replace(strNo, ChrW(53), ChrW(1637)) strNo = Replace(strNo, ChrW(54), ChrW(1638)) strNo = Replace(strNo, ChrW(55), ChrW(1639)) strNo = Replace(strNo, ChrW(56), ChrW(1640)) strNo = Replace(strNo, ChrW(57), ChrW(1641)) MyNo = strNo ElseIf strLng = "En" Then strNo = Replace(strNo, ChrW(1632), ChrW(48)) strNo = Replace(strNo, ChrW(1633), ChrW(49)) strNo = Replace(strNo, ChrW(1634), ChrW(50)) strNo = Replace(strNo, ChrW(1635), ChrW(51)) strNo = Replace(strNo, ChrW(1636), ChrW(52)) strNo = Replace(strNo, ChrW(1637), ChrW(53)) strNo = Replace(strNo, ChrW(1638), ChrW(54)) strNo = Replace(strNo, ChrW(1639), ChrW(55)) strNo = Replace(strNo, ChrW(1640), ChrW(56)) strNo = Replace(strNo, ChrW(1641), ChrW(57)) MyNo = strNo End If End Function الروتين رقم 4 MnthName اسماء الشهور الهجرى - العربى( الميلادى) - الانجليزيى( الميلادى) - اختصارالانجليزيى( الميلادى) - القبطى - السريانى ' .__ __. ___ .___ ___. _______ _______. ______ _______ .___________. __ __ _______ .___ ___. ______ .__ __. .___________. __ __ _______. ' | \ | | / \ | \/ | | ____| / | / __ \ | ____| | || | | | | ____| | \/ | / __ \ | \ | | | || | | | / | ' | \| | / ^ \ | \ / | | |__ | (----` | | | | | |__ `---| |----`| |__| | | |__ | \ / | | | | | | \| | `---| |----`| |__| | | (----` ' | . ` | / /_\ \ | |\/| | | __| \ \ | | | | | __| | | | __ | | __| | |\/| | | | | | | . ` | | | | __ | \ \ ' | |\ | / _____ \ | | | | | |____ .----) | | `--' | | | | | | | | | | |____ | | | | | `--' | | |\ | | | | | | | .----) | ' |__| \__| /__/ \__\ |__| |__| |_______||_______/ \______/ |__| |__| |__| |__| |_______| |__| |__| \______/ |__| \__| |__| |__| |__| |_______/ ' Public Function MnthName(ByVal dtAnyDate As Date, ByVal strLng As String) 'to call the Function 'To Hijri 'txtMonthNameHijri =MnthName(txtDate,"HJ") 'To Arabic 'txtMonthNameArabic =MnthName(txtDate,"Ar") 'To English 'txtMonthNameEnglish =MnthName(txtDate,"En") 'To English Short 'txtMonthNameEnglish =MnthName(txtDate,"EnShrt") 'To Coptic 'txtMonthNameCoptic =MnthName(txtDate,"Cpti") 'To Syriac 'txtMonthNameSyriac =MnthName(txtDate,"Syr") Dim str01 As String Dim str02 As String Dim str03 As String Dim str04 As String Dim str05 As String Dim str06 As String Dim str07 As String Dim Str08 As String Dim Str09 As String Dim Str10 As String Dim Str11 As String Dim Str12 As String If strLng = "HJ" Then str01 = ChrW("1605") & ChrW("1581") & ChrW("1585") & ChrW("1605") str02 = ChrW("1589") & ChrW("1601") & ChrW("1585") str03 = ChrW("1585") & ChrW("1576") & ChrW("1610") & ChrW("1593") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1571") & ChrW("1608") & ChrW("1604") str04 = ChrW("1585") & ChrW("1576") & ChrW("1610") & ChrW("1593") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1570") & ChrW("1582") & ChrW("1585") str05 = ChrW("1580") & ChrW("1605") & ChrW("1575") & ChrW("1583") & ChrW("1610") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1571") & ChrW("1608") & ChrW("1604") & ChrW("1610") str06 = ChrW("1580") & ChrW("1605") & ChrW("1575") & ChrW("1583") & ChrW("1610") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1570") & ChrW("1582") & ChrW("1585") & ChrW("1577") str07 = ChrW("1585") & ChrW("1580") & ChrW("1576") Str08 = ChrW("1588") & ChrW("1593") & ChrW("1576") & ChrW("1575") & ChrW("1606") Str09 = ChrW("1585") & ChrW("1605") & ChrW("1590") & ChrW("1575") & ChrW("1606") Str10 = ChrW("1588") & ChrW("1608") & ChrW("1575") & ChrW("1604") Str11 = ChrW("1584") & ChrW("1608") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1602") & ChrW("1593") & ChrW("1583") & ChrW("1577") Str12 = ChrW("1584") & ChrW("1608") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1581") & ChrW("1580") & ChrW("1577") ElseIf strLng = "Ar" Then str01 = ChrW("1610") & ChrW("1606") & ChrW("1575") & ChrW("1610") & ChrW("1585") str02 = ChrW("1601") & ChrW("1576") & ChrW("1585") & ChrW("1575") & ChrW("1610") & ChrW("1585") str03 = ChrW("1605") & ChrW("1575") & ChrW("1585") & ChrW("1587") str04 = ChrW("1571") & ChrW("1576") & ChrW("1585") & ChrW("1610") & ChrW("1604") str05 = ChrW("1605") & ChrW("1575") & ChrW("1610") & ChrW("1608") str06 = ChrW("1610") & ChrW("1608") & ChrW("1606") & ChrW("1610") & ChrW("1577") str07 = ChrW("1610") & ChrW("1608") & ChrW("1604") & ChrW("1610") & ChrW("1577") Str08 = ChrW("1571") & ChrW("1594") & ChrW("1587") & ChrW("1591") & ChrW("1587") Str09 = ChrW("1587") & ChrW("1576") & ChrW("1578") & ChrW("1605") & ChrW("1576") & ChrW("1585") Str10 = ChrW("1575") & ChrW("1603") & ChrW("1578") & ChrW("1608") & ChrW("1576") & ChrW("1585") Str11 = ChrW("1606") & ChrW("1608") & ChrW("1601") & ChrW("1605") & ChrW("1576") & ChrW("1585") Str12 = ChrW("1583") & ChrW("1610") & ChrW("1587") & ChrW("1605") & ChrW("1576") & ChrW("1585") ElseIf strLng = "En" Then str01 = "January" str02 = "February" str03 = "March" str04 = "April" str05 = "May" str06 = "June" str07 = "July" Str08 = "August" Str09 = "September" Str10 = "October" Str11 = "November" Str12 = "December" ElseIf strLng = "EnShrt" Then str01 = "Jan" str02 = "Feb" str03 = "Mar" str04 = "Apr" str05 = "May" str06 = "Jun" str07 = "Jul" Str08 = "Aug" Str09 = "Sep" Str10 = "Oct" Str11 = "Nov" Str12 = "Dec" ElseIf strLng = "Cpti" Then str01 = ChrW("1591") & ChrW("1608") & ChrW("1576") & ChrW("1577") str02 = ChrW("1571") & ChrW("1605") & ChrW("1588") & ChrW("1610") & ChrW("1585") str03 = ChrW("1576") & ChrW("1585") & ChrW("1605") & ChrW("1607") & ChrW("1575") & ChrW("1578") str04 = ChrW("1576") & ChrW("1585") & ChrW("1605") & ChrW("1608") & ChrW("1583") & ChrW("1577") str05 = ChrW("1576") & ChrW("1588") & ChrW("1606") & ChrW("1587") str06 = ChrW("1576") & ChrW("1572") & ChrW("1608") & ChrW("1606") & ChrW("1577") str07 = ChrW("1571") & ChrW("1576") & ChrW("1610") & ChrW("1576") Str08 = ChrW("1605") & ChrW("1587") & ChrW("1585") & ChrW("1609") Str09 = ChrW("1578") & ChrW("1608") & ChrW("1578") Str10 = ChrW("1576") & ChrW("1575") & ChrW("1576") & ChrW("1577") Str11 = ChrW("1607") & ChrW("1575") & ChrW("1578") & ChrW("1608") & ChrW("1585") Str12 = ChrW("1603") & ChrW("1610") & ChrW("1575") & ChrW("1607") & ChrW("1603") ElseIf strLng = "Syr" Then str01 = ChrW("1603") & ChrW("1575") & ChrW("1606") & ChrW("1608") & ChrW("1606") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1579") & ChrW("1575") & ChrW("1606") & ChrW("1610") str02 = ChrW("1588") & ChrW("1576") & ChrW("1575") & ChrW("1591") str03 = ChrW("1570") & ChrW("1584") & ChrW("1575") & ChrW("1585") str04 = ChrW("1606") & ChrW("1610") & ChrW("1587") & ChrW("1575") & ChrW("1606") str05 = ChrW("1571") & ChrW("1610") & ChrW("1575") & ChrW("1585") str06 = ChrW("1581") & ChrW("1586") & ChrW("1610") & ChrW("1585") & ChrW("1575") & ChrW("1606") str07 = ChrW("1578") & ChrW("1605") & ChrW("1608") & ChrW("1586") Str08 = ChrW("1570") & ChrW("1576") Str09 = ChrW("1571") & ChrW("1610") & ChrW("1604") & ChrW("1608") & ChrW("1604") Str10 = ChrW("1578") & ChrW("1588") & ChrW("1585") & ChrW("1610") & ChrW("1606") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1571") & ChrW("1608") & ChrW("1604") Str11 = ChrW("1578") & ChrW("1588") & ChrW("1585") & ChrW("1610") & ChrW("1606") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1579") & ChrW("1575") & ChrW("1606") & ChrW("1610") Str12 = ChrW("1603") & ChrW("1575") & ChrW("1606") & ChrW("1608") & ChrW("1606") & ChrW("32") & ChrW("1575") & ChrW("1604") & ChrW("1571") & ChrW("1608") & ChrW("1604") End If MnthName = Choose(Format(dtAnyDate, "MM"), str01, str02, str03, str04, str05, str06, str07, Str08, Str09, Str10, Str11, Str12) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 5 DayName اسماء الايام - العربى - الانجليزى- اختصار الانجليزى ' .__ __. ___ .___ ___. _______ _______. ______ _______ _______ ___ ____ ____ _______. ' | \ | | / \ | \/ | | ____| / | / __ \ | ____| | \ / \ \ \ / / / | ' | \| | / ^ \ | \ / | | |__ | (----` | | | | | |__ | .--. | / ^ \ \ \/ / | (----` ' | . ` | / /_\ \ | |\/| | | __| \ \ | | | | | __| | | | | / /_\ \ \_ _/ \ \ ' | |\ | / _____ \ | | | | | |____ .----) | | `--' | | | | '--' | / _____ \ | | .----) | ' |__| \__| /__/ \__\ |__| |__| |_______||_______/ \______/ |__| |_______/ /__/ \__\ |__| |_______/ ' Public Function DayName(ByVal dtAnyDate As Date, ByVal strLng As String) 'to call the Function 'To Arabic Day Name 'txtDayNameAR =DayName(txtDate,"Ar") 'To English Day Name 'txtDayNameAR =DayName(txtDate,"En") 'To English Short Day Name 'txtDayNameEnòShrt =DayName(txtDate,"EnShrt") Dim strSat As String Dim strSun As String Dim strMon As String Dim strTues As String Dim strWed As String Dim strThurs As String Dim strFri As String If strLng = "Ar" Then strSat = ChrW("1575") & ChrW("1604") & ChrW("1587") & ChrW("1576") & ChrW("1578") strSun = ChrW("1575") & ChrW("1604") & ChrW("1575") & ChrW("1581") & ChrW("1583") strMon = ChrW("1575") & ChrW("1604") & ChrW("1575") & ChrW("1579") & ChrW("1606") & ChrW("1610") & ChrW("1606") strTues = ChrW("1575") & ChrW("1604") & ChrW("1579") & ChrW("1604") & ChrW("1575") & ChrW("1579") & ChrW("1575") & ChrW("1569") strWed = ChrW("1575") & ChrW("1604") & ChrW("1575") & ChrW("1585") & ChrW("1576") & ChrW("1593") & ChrW("1575") & ChrW("1569") strThurs = ChrW("1575") & ChrW("1604") & ChrW("1582") & ChrW("1605") & ChrW("1610") & ChrW("1587") strFri = ChrW("1575") & ChrW("1604") & ChrW("1580") & ChrW("1605") & ChrW("1593") & ChrW("1577") ElseIf strLng = "En" Then strSat = "Saturday" strSun = "Sunday" strMon = "Monday" strTues = "Tuesday" strWed = "Wednesday" strThurs = "Thursday" strFri = "Friday" ElseIf strLng = "EnShrt" Then strSat = "Sat" strSun = "Sun" strMon = "Mon" strTues = "Tue" strWed = "Wed" strThurs = "Thurs" strFri = "Fri" End If DayName = Choose(Weekday(dtAnyDate), strSun, strMon, strTues, strWed, strThurs, strFri, strSat) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 6 عدد ايام الشهر ' .__ __. __ __ .___ ___. .______ _______ .______ ______ _______ _______ ___ ____ ____ _______. ' | \ | | | | | | | \/ | | _ \ | ____|| _ \ / __ \ | ____| | \ / \ \ \ / / / | ' | \| | | | | | | \ / | | |_) | | |__ | |_) | | | | | | |__ | .--. | / ^ \ \ \/ / | (----` ' | . ` | | | | | | |\/| | | _ < | __| | / | | | | | __| | | | | / /_\ \ \_ _/ \ \ ' | |\ | | `--' | | | | | | |_) | | |____ | |\ \----. | `--' | | | | '--' | / _____ \ | | .----) | ' |__| \__| \______/ |__| |__| |______/ |_______|| _| `._____| \______/ |__| |_______/ /__/ \__\ |__| |_______/ ' ______ _______ _______. _______ __ _______ ______ .___________. _______ _______ .___ ___. ______ .__ __. .___________. __ __ ' / __ \ | ____| / || ____|| | | ____| / || || ____|| \ | \/ | / __ \ | \ | | | || | | | ' | | | | | |__ | (----`| |__ | | | |__ | ,----'`---| |----`| |__ | .--. | | \ / | | | | | | \| | `---| |----`| |__| | ' | | | | | __| \ \ | __| | | | __| | | | | | __| | | | | | |\/| | | | | | | . ` | | | | __ | ' | `--' | | | .----) | | |____ | `----.| |____ | `----. | | | |____ | '--' | | | | | | `--' | | |\ | | | | | | | ' \______/ |__| |_______/ |_______||_______||_______| \______| |__| |_______||_______/ |__| |__| \______/ |__| \__| |__| |__| |__| ' Public Function NumofDays(ByVal dtAnyDate As Date) NumofDays = Day(DateSerial(Year(dtAnyDate), Month(dtAnyDate) + 1, 0)) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 7 تاريخ آخر يوم فى الشهر ' _______ ___ .___________. _______ ______ _______ __ ___ _______..___________. _______ ___ ____ ____ ' | \ / \ | || ____| / __ \ | ____| | | / \ / || | | \ / \ \ \ / / ' | .--. | / ^ \ `---| |----`| |__ | | | | | |__ | | / ^ \ | (----``---| |----` | .--. | / ^ \ \ \/ / ' | | | | / /_\ \ | | | __| | | | | | __| | | / /_\ \ \ \ | | | | | | / /_\ \ \_ _/ ' | '--' | / _____ \ | | | |____ | `--' | | | | `----. / _____ \ .----) | | | | '--' | / _____ \ | | ' |_______/ /__/ \__\ |__| |_______| \______/ |__| |_______|/__/ \__\ |_______/ |__| |_______/ /__/ \__\ |__| ' ______ _______ _______. _______ __ _______ ______ .___________. _______ _______ .___ ___. ______ .__ __. .___________. __ __ ' / __ \ | ____| / || ____|| | | ____| / || || ____|| \ | \/ | / __ \ | \ | | | || | | | ' | | | | | |__ | (----`| |__ | | | |__ | ,----'`---| |----`| |__ | .--. | | \ / | | | | | | \| | `---| |----`| |__| | ' | | | | | __| \ \ | __| | | | __| | | | | | __| | | | | | |\/| | | | | | | . ` | | | | __ | ' | `--' | | | .----) | | |____ | `----.| |____ | `----. | | | |____ | '--' | | | | | | `--' | | |\ | | | | | | | ' \______/ |__| |_______/ |_______||_______||_______| \______| |__| |_______||_______/ |__| |__| \______/ |__| \__| |__| |__| |__| ' Public Function LastDayInMonth(ByVal dtAnyDate As Date) As Date 'to call the Function 'txtLastDayInMonth =LastDayInMonth(txtDate) LastDayInMonth = DateSerial(Year(dtAnyDate), Month(dtAnyDate) + 1, 0) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 8 تاريخ اول يوم فى الشهر Public Function FstDayOfMth(ByVal dtAnyDate As Date) As Date On Error GoTo handleError FstDayOfMth = DateSerial(Year(dtAnyDate), Month(dtAnyDate), 1) GoTo handleSuccess Exit Function handleSuccess: GoTo cleanUp Exit Function handleError: If Err.Number = 94 Then 'createFolder = True Else MsgBox "Error Number : " & Err.Number & vbNewLine & "Error Description : " & Err.Description End If GoTo cleanUp cleanUp: Exit Function End Function الروتين رقم 9 تاريخ اول يوم فى الشهر التالى Public Function FstDayOfNextMnth(ByVal dtAnyDate As Date) As Date FstDayOfNextMnth = DateSerial(Year(dtAnyDate), Month(dtAnyDate) + 1, 1) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 10 تاريخ اول يوم فى الشهر السابق Public Function FstDayPrevMnth(ByVal dtAnyDate As Date) As Date FstDayPrevMnth = DateSerial(Year(dtAnyDate), Month(dtAnyDate) - 1, 1) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 11 تاريخ آخر يوم فى الشهر Public Function LstDayMnth(ByVal dtAnyDate As Date) As Date LstDayMnth = DateSerial(Year(dtAnyDate), Month(dtAnyDate) + 1, 0) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 12 تاريخ آخر يوم فى الشهر التالى Public Function LstDayNextMnth(ByVal dtAnyDate As Date) As Date LstDayNextMnth = DateSerial(Year(dtAnyDate), Month(dtAnyDate) + 2, 0) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 13 تاريخ آخر يوم فى الشهر السابق Public Function LstDayPrevMnth(ByVal dtAnyDate As Date) As Date LstDayPrevMnth = DateSerial(Year(dtAnyDate), Month(dtAnyDate), 0) End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 14 ظهور لغة الوقت التى تريدها - عربى - انجلبزى Public Function TimeByLng(ByVal dtAnyDate As Variant, ByVal strLng As String) Dim strAM As String: strAM = ChrW("1589") & ChrW("1576") & ChrW("1575") & ChrW("1581") & ChrW("1575") & ChrW("1611") Dim strPM As String: strPM = ChrW("1605") & ChrW("1587") & ChrW("1575") & ChrW("1569") & ChrW("1611") If strLng = "Ar" Then TimeByLng = MyNo(Replace(Replace(Format(dtAnyDate, "hh:nn:ss AM/PM"), "AM", strAM), "PM", strPM), "ar") ElseIf strLng = "En" Then TimeByLng = MyNo(Replace(Replace(Format(dtAnyDate, "hh:nn:ss AM/PM"), strAM, "AM"), strPM, "PM"), "En") End If End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 15 ظهور لغة الوقت التى تريدها - عربى - انجلبزى Public Function TimeLng(ByVal strLng As String) Dim strAM As String: strAM = ChrW("1589") & ChrW("1576") & ChrW("1575") & ChrW("1581") & ChrW("1575") & ChrW("1611") Dim strPM As String: strPM = ChrW("1605") & ChrW("1587") & ChrW("1575") & ChrW("1569") & ChrW("1611") If strLng = "Ar" Then TimeLng = MyNo(Replace(Replace(Format(Now(), "hh:nn:ss AM/PM"), "AM", strAM), "PM", strPM), "ar") ElseIf strLng = "En" Then TimeLng = MyNo(Replace(Replace(Format(Now(), "hh:nn:ss AM/PM"), strAM, "AM"), strPM, "PM"), "En") End If End Function '----------------------------End------------------------------------------------------------------------------------------- الروتين رقم 16 ظهور لغة التاريخ التى تريدها - عربى - انجلبزى Public Function DateByLng(ByVal dtAnyDate As Variant, ByVal strLng As String) If strLng = "Ar" Then DateByLng = MyNo(Format(dtAnyDate, "dd\/mm\/yyyy") & Space(2) & ChrW(1605), "ar") ElseIf strLng = "En" Then DateByLng = MyNo(Format(dtAnyDate, "dd\/mm\/yyyy") & Space(2) & ChrW(1605), "En") End If End Function '----------------------------End------------------------------------------------------------------------------------------- يتبع .... DateFunctions.zip
    1 point
×
×
  • اضف...

Important Information