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

ترقيم آلي حسب النوع وترقيم حسب السنة والشهر _ معدل


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

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

يعني الاثنين جميعا في ترقيم واحد ؟؟؟؟

هذا الكود الأول 

'لو اردت خانة الرقم تصبح 4 اصفار طبق التعليقات التي امام الاسطر
Dim xLast, xNext As Integer
Dim i, t, tt, x As Integer
t = Format(Date, "yy")
tt = Format(DMax("PatientID", "tblPatients"), "yy")
i = Format(Me.p_Date, "mmyy")
xLast = Right(DMax("PatientID", "tblPatients", tt = t), 3)       ' يصبح الرقم 4 بدلا من 3
If IsNull(xLast) Then
xNext = 1
Else
xNext = xLast + 1
End If
Me.PatientID = i & "/" & Format(xNext, "000")             'وهنا تزود صفر على الثلاث اصفار

غير "yy" الى "mmyy" في الموضعين ليصبح الكود هكذا

Private Sub p_Date_AfterUpdate()
Dim xLast, xNext As Integer
Dim i, t, tt, x As Integer
t = Format(Date, "mmyy")
tt = Format(DMax("PatientID", "tblPatients"), "mmyy")
i = Format(Me.p_Date, "mmyy")
xLast = Right(DMax("PatientID", "tblPatients", tt = t), 3)
If IsNull(xLast) Then
xNext = 1
Else
xNext = xLast + 1
End If
Me.PatientID = i & "/" & Format(xNext, "000")
End Sub

 

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

السلام عليكم

شكرا شكرا جزيلا

هذا بالضبط ما كنت بحاجة اليه 

ولكن واجهتني مشكلة الرقم التسلسلي يبقى كما هو و لا يزيد1 في السجل الجديد

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

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