elmagd2004 قام بنشر يونيو 21, 2022 قام بنشر يونيو 21, 2022 Option Compare Database Function RcNumQ1(mID As Variant, fldName As String) As Variant Dim RstClone As Recordset Dim Fld As Field Dim i As Long RcNumQ1 = Null If IsNull(mID) Then Exit Function Set RstClone = CurrentDb.QueryDefs("name of query").OpenRecordset If RstClone.RecordCount = 0 Then Exit Function Set Fld = RstClone.Fields(fldName) With RstClone .MoveFirst Do Until .EOF i = i + 1 If Fld = mID Then Exit Do .MoveNext Loop End With RstClone.Close RcNumQ1 = i End Function
Eng.Qassim قام بنشر يونيو 21, 2022 قام بنشر يونيو 21, 2022 وعليكم السلام ..جرب واعلمنا النتيجة خذ بالك من ال parameter Public Function RcNumQ1(mID As Variant, fldName As String, MyQuery As QueryDef) As Variant Dim RstClone As Recordset Dim Fld As Field Dim i As Long RcNumQ1 = Null If IsNull(mID) Then Exit Function Set RstClone = CurrentDb.QueryDefs("MyQuery").OpenRecordset If RstClone.RecordCount = 0 Then Exit Function Set Fld = RstClone.Fields(fldName) With RstClone .MoveFirst Do Until .EOF i = i + 1 If Fld = mID Then Exit Do .MoveNext Loop End With RstClone.Close RcNumQ1 = i End Function 1
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.