09-10-13, 08:39 PM
يسلموا شباب تم حل المشكلة وتم تعديل الكود
PHP كود :
Dim SQLs As String
Dim S As Integer
If Text6.Text = "" Then
MsgBox "ادخل رقم التلفون", vbCritical, "خطأ"
Text6.SetFocus
Exit Sub
End If
SQLs = "Select * From Labadd where InvNo=" & Trim(Text6.Text) & ""
If RSS.State = adStateOpen Then RSS.Close
RSS.Open SQLs, CN, adOpenKeyset, adLockPessimistic
With Grid
If RSS.RecordCount < 1 Then
For S = 1 To .Rows - 1
RSS.AddNew
RSS.Fields("InvNo") = Text6.Text
RSS.Fields("DTF") = Format(Me.DT1.Value, "yyyy/MM/dd")
RSS.Fields("Nmred") = Combo1.Text
RSS.Fields("Gender") = Combo3.Text
RSS!Code = .TextMatrix(S, 0)
RSS!Nmrd = .TextMatrix(S, 1)
RSS!Result = .TextMatrix(S, 2)
RSS!Price = .TextMatrix(S, 3)
RSS!Ndoctor = .TextMatrix(S, 4)
RSS.Update
Next
MsgBox "تم حفظ بيانات التلفون بنجاح ", vbInformation, "حفظ"
ClearAllA Me
lblTotal.Caption = ""
Call Grd
Else
MsgBox "يوجد خطأ اثناء الحفظ --- رقم التلفون مسجل من قبل", vbCritical, "خطأ"
End If
End With
