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

فتح النماذج حسب اسم المستخدم


أبو حوده
إذهب إلى أفضل إجابة Solved by Ahmed.IQ,

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

السلام عليكم ورحمة الله وبركاتة 

جمعة مباركة عليكم جميعا 

اخوانى كنت محتاج تعديل فى الكود دة علشان اخليه يفتح النموذج  MAIN1  عندما يكون اسم المستخدم خالد

وباقى المستخدمين يفتح زى مهو فى الكود  frmend

يعنى خالد يفتح ..... main1 

اى مستخدم اخر يفتح .... frmend

 

            LogUser.UserName = Me.user
                    LogUser.pass = Me.pass
                        If LogUser.Valid Then
                       Set MyUser = LogUser
                                    DoCmd.Close
                 "DoCmd.OpenForm "frmend

رابط هذا التعليق
شارك

  

56 دقائق مضت, أبو حوده said:

السلام عليكم ورحمة الله وبركاتة 

جمعة مباركة عليكم جميعا 

اخوانى كنت محتاج تعديل فى الكود دة علشان اخليه يفتح النموذج  MAIN1  عندما يكون اسم المستخدم خالد

وباقى المستخدمين يفتح زى مهو فى الكود  frmend

يعنى خالد يفتح ..... main1 

اى مستخدم اخر يفتح .... frmend

 

            LogUser.UserName = Me.user
                    LogUser.pass = Me.pass
                        If LogUser.Valid Then
                       Set MyUser = LogUser
                                    DoCmd.Close
                 "DoCmd.OpenForm "frmend

وعليكم السلام 

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

على العموم انظر لهذا الجزء من الكود وحاول ان تطوعه على حسب ملفك.

Dim UserSecurity As Integer
        UserSecurity = (DLookup("UserSecurityLevelID", "tblUser", "UserLogin='" & Me.txtLoginID.Value & "'"))
        Select Case UserSecurity
        Case Is = 1
        DoCmd.OpenForm "_Main1"
        Case Is = 2
        DoCmd.OpenForm "_Main2"
        Case Is = 3
        DoCmd.OpenForm "_Main3"
        End Select

بالتوفيق

  • Like 1
رابط هذا التعليق
شارك

اخى الفاضل @سامي الحداد المثال لاخى الكريم @ابو جودي وهو خاص بالصلاحيات فكنت عاوز اطوع النموزج على قاعدتى وهى انى عاوز اخلى يوزر معين يفتح على شاشة خاصة به دون باقى المستخدمين لغرض معين وباقى المستخدمين تفتح النموذج الافتراضى وارفقت المثال كامل واليوزر خالد الباسورد بتاعة 123 واى يوزر تانى الباسورد بتاعة هو اسم اليوزر

User permissions.rar

تم تعديل بواسطه أبو حوده
رابط هذا التعليق
شارك

  

2 ساعات مضت, أبو حوده said:

اخى الفاضل @سامي الحداد المثال لاخى الكريم @ابو جودي وهو خاص بالصلاحيات فكنت عاوز اطوع النموزج على قاعدتى وهى انى عاوز اخلى يوزر معين يفتح على شاشة خاصة به دون باقى المستخدمين لغرض معين وباقى المستخدمين تفتح النموذج الافتراضى وارفقت المثال كامل واليوزر خالد الباسورد بتاعة 123 واى يوزر تانى الباسورد بتاعة هو اسم اليوزر

User permissions.rar 867.07 kB · 8 downloads

تفضل أخي الكريم

عسى ات يكون هو المطلوب.

Private Sub LoginBT_Click()
On Error Resume Next
Dim LogUser As New CUser
    If trycount > 3 Then
        MsgBox " Of a good Muslim is his leaving alone what does not concern him", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
        MsgBox " The program will be closing now ,,, Please check designer ", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
        DoCmd.Quit
    ElseIf IsNull(Me.user) Then
        MsgBox ("Please, you must enter your user name ")
        Me.user.SetFocus
    ElseIf IsNull(Me.pass) Then
        MsgBox (" Please, you must enter your password ")
        Me.pass.SetFocus
    ElseIf Len(Trim(Me.pass)) > 20 Then
        MsgBox (" Shall not exceed twenty password letter or number")
        Me.pass.SetFocus
'-------    Mohamed Essam ------ secreted user to enter the activation model and the abolition of shift team and hide and show tables       ---------
            ElseIf [user] = "sadmin" And [pass] = "sadmin" Then
            DoCmd.Close
            DoCmd.OpenForm "MSysEdit"
            ElseIf [user] = "adminx" And [pass] = "adminx" Then
            DoCmd.Close
            DoCmd.OpenForm "UsersAbility", acNormal
'-------    Mohamed Essam ------ secreted user to enter the activation model and the abolition of shift team and hide and show tables       ---------
            ElseIf [user] = "خالد" And [pass] = "123" Then
            DoCmd.Close
            DoCmd.OpenForm "Main1"
        Else
            LogUser.UserName = Me.user
            LogUser.pass = Me.pass
            If LogUser.Valid Then
            Set MyUser = LogUser
            DoCmd.Close
            DoCmd.OpenForm "frmend"
           

        Else
            MsgBox " User name or password is incorrect. Please try again ,,,", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
            trycount = trycount + 1
        End If
    End If
End Sub

مع خالص التقدير للاستاذ @ابو جودي محمد عصام .

بالتوفيق

رابط هذا التعليق
شارك

اخى الفاضل  @سامي الحدادمع احترامى الشديد لحضرتك انا بالفعل عملتها بالشكل دة بس ظهرت لى مشكله ان اليوزر دة كدة مش بيطبق عليه بعض الصلاحيات داخل باقى النمازج يعنى لما اجى اعطيلة صلاحية بفتح نموزج معين مش بيطبق عليه لاكن باقى اليوزرات اللى دخلت بيطبق عليها علشان كدة رجعت لحضراتكم 

تم تعديل بواسطه أبو حوده
رابط هذا التعليق
شارك

  • أفضل إجابة

تفضل جرب هذا الكود ,,,

 

On Error Resume Next
Dim LogUser As New CUser
    If trycount > 3 Then
        MsgBox " Of a good Muslim is his leaving alone what does not concern him", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
        MsgBox " The program will be closing now ,,, Please check designer ", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
        DoCmd.Quit
    ElseIf IsNull(Me.user) Then
        MsgBox ("Please, you must enter your user name ")
        Me.user.SetFocus
    ElseIf IsNull(Me.pass) Then
        MsgBox (" Please, you must enter your password ")
        Me.pass.SetFocus
    ElseIf Len(Trim(Me.pass)) > 20 Then
        MsgBox (" Shall not exceed twenty password letter or number")
        Me.pass.SetFocus
'-------    Mohamed Essam ------ secreted user to enter the activation model and the abolition of shift team and hide and show tables       ---------
            ElseIf [user] = "sadmin" And [pass] = "sadmin" Then
            DoCmd.Close
            DoCmd.OpenForm "MSysEdit"
            ElseIf [user] = "adminx" And [pass] = "adminx" Then
            DoCmd.Close
            DoCmd.OpenForm "UsersAbility", acNormal
'-------    Mohamed Essam ------ secreted user to enter the activation model and the abolition of shift team and hide and show tables       ---------
        Else
            LogUser.UserName = Me.user
            LogUser.pass = Me.pass
            If LogUser.Valid Then
            Set MyUser = LogUser
            If Me.user = "خالد" Then
            DoCmd.Close
            DoCmd.OpenForm "main1", acNormal
            Else
            DoCmd.Close
            DoCmd.OpenForm "frmend"
            End If

        Else
            MsgBox " User name or password is incorrect. Please try again ,,,", vbOKOnly + vbMsgBoxRight + vbInformation, "Warning!"
            trycount = trycount + 1
        End If
    End If
End Sub

 

  • Like 1
رابط هذا التعليق
شارك

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