اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

الردود الموصى بها

قام بنشر
6 hours ago, منتصر الانسي said:

frmStart من زر X

:biggrin2: نموذج خاص لمشروعك @منتصر الانسي

6 hours ago, منتصر الانسي said:

يعتمد وجاري العمل به 😊

🌹❤️

لعمل زر انهاء واغلاق هذا الكود

1- الغاء الكود

Private Sub Form_Unload(Cancel As Integer)
'    ' منع إغلاق النموذج
'    Cancel = True
'    HandleCloseAttempt
End Sub

2- تعديل كود زر اغلاق وانهاء

كما موضع بسطر الكود في المرفق 

    ' تعطيل إمكانية الإغلاق عند التحميل
    SetAccessCloseAbility False
    ' تفعيل إمكانية الإغلاق عند التحميل
    SetAccessCloseAbility True

Private Sub Run_Click()
On Error GoTo Qut

SetAccessCloseAbility True
Dim frmXrpt            As Integer
Dim frmX               As Integer
Dim rptX               As Integer

For frmXrpt = 1 To 1
For frmX = 0 To Forms.count - 1
    DoCmd.close acForm, Forms(0).name
Next frmX
For rptX = 0 To Reports.count - 1
    DoCmd.close acReport, Reports(0).name
Next rptX
Next frmXrpt

'DoCmd.Quit acQuitSaveAll
SafeExit
Exit Sub
Qut:
MsgBox err.Description

End Sub

===============================================

:نستفيد من اخفاء الملفات بطريقة المتاهات تذكرة لعبة المتاهات كان عند @Foksh مشكلة ما قدر يحلها :biggrin: المهم توضيح

1- قاعدة فارغة لتشغيل القاعدة واغلاق لماذا بسبب ان اختصار سطح المكتب يعرف فيه مكان قاعدة التشغيل 

2- اجعل مجلد القاعدة الفارغه هو اختصار سطح المكتب وعند مجلده اضافة ملفات برقة بيضاء شكلا ووهم ان هذه هي القاعدة 

دالة التشفير وفك التفير :wink2:

تزيد امان مع تفعيل غفل القواعد بكلمة مرور ودالة العكس والمعالجه:rol:

 

المهم جرب طريقة بتشغيل اختصار وهمي

    On Error GoTo ErrorHandler
    Dim folderPath As String
    Dim result As Long
        Dim fs As String
    fs = Application.CurrentProject.Path

    ' تنظيف المسار من أي فواصل أو مسافات زائدة
   '==================( من غير حقل مفقط مسار قاعدة
      folderPath = Trim(fs)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' التحقق من وجود المجلد
    If Dir(folderPath, vbDirectory) = "" Then
        MsgBox "المجلد غير موجود!", vbExclamation, "خطأ"
        Exit Sub
    End If
    
    ' إخفاء المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_HIDDEN)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إخفاء المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إخفاء المجلد!"
        Me.lblStatus.ForeColor = vbRed
    End If
    
    Exit Sub
ErrorHandler:
    Me.lblStatus.Caption = "حدث خطأ: " & err.Description
    Me.lblStatus.ForeColor = vbRed

واذا كان الاستخدام لمفات تتعلق بنظام او القاعدة 

تكتب سطر سطر من غير & Run 

من غير جدول من غير حقول

 

Dim Path_X0  As String
Dim Path_X1 As String
Dim Path_X2 As String
Dim Path_X3 As String
Dim Path_X4 As String
Dim Path_X5 As String
Dim Path_X6 As String
Dim Path_X8 As String
Dim Path_X9 As String
Dim Path_X10 As String
Dim Path_X11 As String
Dim Path_X12 As String
Dim Path_X13 As String
Dim Path_X14 As String
Dim Path_X15 As String
Dim Path_X16 As String
Dim Path_X17 As String
Dim Path_X18 As String
Dim Path_X19 As String
Dim Path_X20 As String
Dim Path_X21 As String
Dim Path_X22 As String
Dim Path_X23 As String
Dim Path_X24 As String
Dim Path_X25 As String
Dim Path_X26 As String
Dim Path_X27 As String
Dim Path_X28 As String
Dim Path_X29 As String
Dim Path_X30 As String
Dim Path_X31 As String
Dim Path_X32 As String
Dim Path_X33 As String
Dim Path_X35 As String
Dim Path_X36 As String
Dim Path_X37 As String
Dim Path_X38 As String
Dim Path_X39 As String
Dim Path_X40 As String
Dim Path_X41 As String

'    On Error GoTo ErrorHandler
    Dim folderPath As String
    Dim result As Long
Dim Run As Integer

Path_X0 = Application.CurrentProject.Path & "\DDB_Control"
Path_X1 = Application.CurrentProject.Path & "\IMG_Company"
Path_X2 = Application.CurrentProject.Path & "\IMG_Company_ReP"
Path_X3 = Application.CurrentProject.Path & "\IMG_Wallpaper_backgreound"
Path_X4 = Application.CurrentProject.Path & "\App_IMG_Wallpaper_backgreound"
Path_X5 = Application.CurrentProject.Path & "\IMG_Editor_Menu"
Path_X6 = Application.CurrentProject.Path & "\Cantry_IMG"
Path_X7 = Application.CurrentProject.Path & "\fonts"
Path_X8 = Application.CurrentProject.Path & "\Icon_Button"
Path_X9 = Application.CurrentProject.Path & "\Icon_Msgbox"
Path_X10 = Application.CurrentProject.Path & "\Sound"
Path_X11 = Application.CurrentProject.Path & "\Wallpaper"
Path_X12 = Application.CurrentProject.Path & "\Video"
Path_X13 = Application.CurrentProject.Path & "\db_BE"
Path_X14 = Application.CurrentProject.Path & "\ExE"
Path_X15 = Application.CurrentProject.Path & "\IMG_Report"
Path_X16 = Application.CurrentProject.Path & "\File_word"
Path_X17 = Application.CurrentProject.Path & "\File_Excel"
Path_X18 = Application.CurrentProject.Path & "\Book"
Path_X19 = Application.CurrentProject.Path & "\File_PowerPoint"
Path_X20 = Application.CurrentProject.Path & "\File_Text"
Path_X21 = Application.CurrentProject.Path & "\File_Code"
Path_X22 = Application.CurrentProject.Path & "\All_InFile_One_Zip_Rar"
Path_X23 = Application.CurrentProject.Path & "\ICOn"
Path_X24 = Application.CurrentProject.Path & "\Icon_bar_DB"
Path_X25 = Application.CurrentProject.Path & "\Icon_bar_Form_Report"
Path_X26 = Application.CurrentProject.Path & "\Icon_Button"
Path_X27 = Application.CurrentProject.Path & "\icon_Gif"
Path_X28 = Application.CurrentProject.Path & "\Icon_Msgbox"
Path_X29 = Application.CurrentProject.Path & "\LinkedDB_Backups"
Path_X30 = Application.CurrentProject.Path & "\Office_Video"
Path_X31 = Application.CurrentProject.Path & "\Qr"
Path_X32 = Application.CurrentProject.Path & "\QR_User"
Path_X33 = Application.CurrentProject.Path & "\Resources"
Path_X34 = Application.CurrentProject.Path & "\World_Cantry"
Path_X35 = Application.CurrentProject.Path & "\Gif_IMG"
Path_X36 = Application.CurrentProject.Path & "\Fix_Photo"
Path_X37 = Application.CurrentProject.Path & "\db_db_db_test_link"
Path_X38 = Application.CurrentProject.Path & "\Corrupted_DBs"
Path_X39 = Application.CurrentProject.Path & "\Corrupted_Archives"
Path_X40 = Application.CurrentProject.Path & "\Change_Dy_Time_All_Table"
Path_X41 = Application.CurrentProject.Path & "\Add Fonts.bmp"
    
    For Run = 0 To 40
    
    If Run = 0 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X0)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 1 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X1)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 2 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X2)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 3 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X3)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 4 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X4)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 5 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X5)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 6 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X6)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 7 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X7)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 8 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X8)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 9 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X9)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 10 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X10)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 11 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X11)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 12 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X12)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 13 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X13)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 14 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X14)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 15 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X15)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 16 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X16)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 17 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X17)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 18 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X18)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 19 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X19)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 20 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X20)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 21 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X21)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 22 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X22)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 23 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X23)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 24 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X24)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 25 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X25)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 26 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X26)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 27 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X27)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 28 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X28)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 29 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X29)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 30 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X30)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 31 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X31)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 32 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X32)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 33 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X33)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 34 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X34)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 35 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X35)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 36 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X36)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 37 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X37)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 38 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X38)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 39 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X39)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 40 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X40)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

    If Run = 41 Then
    ' تنظيف المسار
    folderPath = Trim(Path_X41)
    If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"
    
    ' إظهار المجلد
    result = SetFileAttributes(folderPath, FILE_ATTRIBUTE_NORMAL)
    
    If result <> 0 Then
        Me.lblStatus.Caption = "تم إظهار المجلد بنجاح: " & folderPath
        Me.lblStatus.ForeColor = vbGreen
    Else
        Me.lblStatus.Caption = "فشل في إظهار المجلد أو غير مخفي أساساً!"
        Me.lblStatus.ForeColor = vbRed
    End If
End If

Next

    Exit Sub
ErrorHandler:
    Me.lblStatus.Caption = "حدث خطأ: " & err.Description
    Me.lblStatus.ForeColor = vbRed
End Sub

ما رايك في الفكرة 😇 @منتصر الانسي

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information