عبداللهM قام بنشر يوليو 16, 2023 مشاركة قام بنشر يوليو 16, 2023 (معدل) إخواني أعضاء أوفيسنا السلام عليكم ورحمة الله وبركاته لدية كود يقوم بعمل ترقيم مجموع من سجلات التي يتم اختيار مع تاريخ تلقائي والكن في مشكلة يظهرا رسالة (تعارض الكتابة) ترقيم جديد.rar تم تعديل يوليو 16, 2023 بواسطه عبداللهM تعديل الكود رابط هذا التعليق شارك More sharing options...
أفضل إجابة Barna قام بنشر يوليو 16, 2023 أفضل إجابة مشاركة قام بنشر يوليو 16, 2023 (معدل) 3 ساعات مضت, عبداللهM said: والكن في مشكلة يظهرا رسالة (تعارض الكتابة) طيب جرب هذا <|<><><><><><|> Dim rst As DAO.Recordset Set dbs = CurrentDb date_custom = Date If Len(Me.number_custom & "") <> 0 Then Exit Sub Me.number_custom = Nz(DMax("[number_custom]", "tbl_custom", "year([date_custom])=" & Year(date_custom)), 0) + 1 Set rst = dbs.OpenRecordset("FrmRretsQ") d = Me.number_custom DoCmd.RunCommand acCmdSaveRecord Do Until rst.EOF rst.Edit rst!number_custom = d rst!date_custom = Date rst!emp_company = DYear rst.Update d = d + 1 rst.MoveNext Loop Me.Requery تم تعديل يوليو 16, 2023 بواسطه Barna 4 رابط هذا التعليق شارك More sharing options...
عبداللهM قام بنشر يوليو 16, 2023 الكاتب مشاركة قام بنشر يوليو 16, 2023 بارك الله فيك يا أخي barna وجزأك الله خير الجزاء وهذا هو المطلوب رابط هذا التعليق شارك More sharing options...
شايب قام بنشر يوليو 17, 2023 مشاركة قام بنشر يوليو 17, 2023 مشاركة مع الاستاذ محمد اعتقد ممكن استخدام الامر If Len(Me.number_custom & "") <> 0 Then Exit Sub Dim rst As Recordset Dim a, x As Integer date_custom = Date Me.number_custom = Nz(DMax("[number_custom]", "tbl_custom", "year([date_custom])=" & Year(date_custom)), 0) + 1 Set rst = Me.Form.RecordsetClone x = rst.RecordCount Me.Dirty = False For a = 1 To x rst.Edit rst!number_custom = number_custom rst!date_custom = Date rst!emp_company = DYear rst.Update number_custom = number_custom + 1 rst.MoveNext Next Me.Requery ولكن مع وجود عدد كبير من السجلات التعامل مع الجدول اسرع رابط هذا التعليق شارك More sharing options...
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.