If IsNull(b) Then Beep MsgBox "ياشيخ ،،، يجب أن تضع رقماً في خانة بدء الترقيم", _ vbInformation + vbMsgBoxRight + vbOKOnly, _ "أنتبـه" b.SetFocus Exit Sub End If If IsNull(a) Then MsgBox "ياشيخ ،،، يجب عدم ترك حقل الصف فارغاً", _ vbInformation + vbMsgBoxRight + vbOKOnly, _ "أنتبـه" a.SetFocus Exit Sub End If Dim x Dim rst As ADODB.Recordset Set rst = New ADODB.Recordset Dim sqlstr As String Dim y, z y = CLng([a]) ' a = الصف ' c = الفصل ' b = بدء الترقيم If IsNull(c) Then sqlstr = "select * from start where [alsaf]= " & y Else z = CLng([c]) sqlstr = "select * from start where [alsaf]= " & y & " AND [alfasel] = " & z End If rst.Open sqlstr, CurrentProject.Connection, adOpenKeyset, adLockOptimistic x = rst.MoveFirst MsgBox rst.RecordCount Do While Not rst.EOF rst.Fields(0) = x x = x + 1 rst.Update rst.MoveNext Loop MsgBox "تم تحديث أرقام الجلوس", _ vbInformation + vbMsgBoxRight + vbOKOnly, _ "مبروك" rst.Close Me.Refresh
مع تقديم شكري وتقديري لا خي ابن مسقط