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

اخفاء اشرطة التمرير والتمرير من خلال عجلة الماوس ( الفأرة )


Radwan0
إذهب إلى أفضل إجابة Solved by ابو جودي,

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

ضع الكود الاتى فى موديول 

Public Function DoMouseWheel(frm As Form, lngCount As Long) As Integer

Dim strMsg As String
  If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) And (frm.CurrentView = 1) And (lngCount <> 0&) Then
    RunCommand acCmdSaveRecord
    RunCommand IIf(lngCount < 0&, acCmdRecordsGoToPrevious, acCmdRecordsGoToNext)
    DoMouseWheel = Sgn(lngCount)
  End If
DoCmd.CancelEvent
Response = False

End Function

ثم فى النموذج فى حدث On Mouse Wheel ضع السطر التالى

  Call DoMouseWheel(Me, Count)

 

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

  • 1 month later...
في ٢٩‏/١٠‏/٢٠٢١ at 14:19, ابو جودي said:

ضع الكود الاتى فى موديول 

Public Function DoMouseWheel(frm As Form, lngCount As Long) As Integer

Dim strMsg As String
  If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) And (frm.CurrentView = 1) And (lngCount <> 0&) Then
    RunCommand acCmdSaveRecord
    RunCommand IIf(lngCount < 0&, acCmdRecordsGoToPrevious, acCmdRecordsGoToNext)
    DoMouseWheel = Sgn(lngCount)
  End If
DoCmd.CancelEvent
Response = False

End Function

ثم فى النموذج فى حدث On Mouse Wheel ضع السطر التالى

  Call DoMouseWheel(Me, Count)

 

أستاذنا العزيز @ابو جودي 

أحسن الله إليك ، احتجت لهذا الكود في أحد قواعد البيانات اللي شغال عليها ..😊:fff:

لكن عند التشغيل تظهر لي رسالة بأن هذا المتغير غير معرف :

Response = False

كيف يتم تعريفه لكي يعمل الكود ؟ 

وكذلك تظهر رسائل خطأ عندما تكون أول السجلات ويحاول الكود بأن يذهب للسجل السابق بالأمر : acCmdRecordsGoToPrevious

لكنها تختفي مع On Error Resume Next

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

  • أفضل إجابة

ضع الكود الاتى فى موديول  :fff:

Public Function DoMouseWheel(frm As Form, lngCount As Long) As Integer
On Error GoTo Err_Handler
    Dim strMsg As String
    If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) And (frm.CurrentView = 1) And (lngCount <> 0&) Then
        RunCommand acCmdSaveRecord
        RunCommand IIf(lngCount < 0&, acCmdRecordsGoToPrevious, acCmdRecordsGoToNext)
        DoMouseWheel = Sgn(lngCount)
    End If
Exit_Handler:
    Exit Function
Err_Handler:
    Select Case Err.Number
    Case 2046&
    Resume Next
    Case 3314&, 2101&, 2115&
        strMsg = "Cannot scroll to another record, as this one can't be saved."
        MsgBox strMsg, vbInformation, "Cannot scroll"
    Case Else
        strMsg = "Error " & Err.Number & ": " & Err.Description
        MsgBox strMsg, vbInformation, "Cannot scroll"
    End Select
    Resume Exit_Handler
End Function

ثم فى النموذج فى حدث On Mouse Wheel ضع السطر التالى

    Call DoMouseWheel(Me, Count)

 

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

في ٢٤‏/١٢‏/٢٠٢١ at 04:06, ابو جودي said:

ضع الكود الاتى فى موديول  :fff:

Public Function DoMouseWheel(frm As Form, lngCount As Long) As Integer
On Error GoTo Err_Handler
    Dim strMsg As String
    If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) And (frm.CurrentView = 1) And (lngCount <> 0&) Then
        RunCommand acCmdSaveRecord
        RunCommand IIf(lngCount < 0&, acCmdRecordsGoToPrevious, acCmdRecordsGoToNext)
        DoMouseWheel = Sgn(lngCount)
    End If
Exit_Handler:
    Exit Function
Err_Handler:
    Select Case Err.Number
    Case 2046&
    Resume Next
    Case 3314&, 2101&, 2115&
        strMsg = "Cannot scroll to another record, as this one can't be saved."
        MsgBox strMsg, vbInformation, "Cannot scroll"
    Case Else
        strMsg = "Error " & Err.Number & ": " & Err.Description
        MsgBox strMsg, vbInformation, "Cannot scroll"
    End Select
    Resume Exit_Handler
End Function

ثم فى النموذج فى حدث On Mouse Wheel ضع السطر التالى

    Call DoMouseWheel(Me, Count)

 

إشتغلت أحسن وأحلى من العسل 😊👌🏼

ربنا يديك تلاته مليون جنيه ياشيخ 😄

@ابو جودي

وياريت لو يختارها الأستاذ @RaDwAn00 كأفضل إجابة 🙂 

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

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