السلام عليكم
عندي مشكلة مرتبطة بقاعدة IF
لما يتوافق الشرط ينتهى البرنامج على خير
وعندما لا يتوافق الشرط لا يحدث اي شيئ نهائيا في البرنامج
غيرت مكان end if اكثر من مره وعدلت الكود اكثر من مره لكن بدون فائدة
هذا هو الكود
Dim LastTime As String = Dr("ptime")
Dim LastType As String = Dr("Type_P")
Dim XxX As String = "تركيب"
Dim iResponse As String
If Dr("Type_P") = XxX Then
iResponse = MsgBox("اخر حجز " + LastType + " " & vbCrLf & "ميعاد الدخول " + LastTime + "" & vbCrLf & "هل اضفت ربع ساعة اضافية ؟", vbYesNoCancel + vbExclamation + vbApplicationModal + vbDefaultButton1, "تنبيه هام ")
Select Case iResponse
Case vbYes
Dr.Close()
Cmd.CommandText = " Insert into reg(PCode,Patient_Name,PDate,Ptime,Price,Type_P,P_Note)Values('" & PCode.Text & "' ,'" & Patient_Name.Text & "', '" & PDate.Text & "', '" & Ptime.Text & "', '" & Price.Text & "','" & Type_P.Text & "','" & P_Note.Text & "' )"
Cmd.ExecuteNonQuery()
MsgBox("تم حفظ البيانات بنجاح ", MsgBoxStyle.MsgBoxRight + vbOKOnly + vbInformation + vbApplicationModal + vbDefaultButton1, "حفظ")
CN.Close()
PCode.Text = ""
Patient_Name.Text = ""
PDate.Text = ""
Ptime.Text = ""
PDate.Text = ""
Price.Text = ""
Type_P.Text = ""
P_Note.Text = ""
Ptime.Enabled = False
PDate.Enabled = False
Price.Enabled = False
Type_P.Enabled = False
P_Note.Enabled = False
Case vbNo
Exit Sub
End Select
onH = n
Dr.Close()
End If