22-04-25, 08:33 PM
بارك الله فيكم تم حلَّ المشلكة بهذا الكود
في الفورم الرئيسي
وفي الفورم تم إنشاء صب
في الفورم الرئيسي
كود :
Dim frm As New FormSemester1 : frm.MdiParent = Me : frm.Show() : frm.fillcmb_TBL_Classroom()وفي الفورم تم إنشاء صب
كود :
Public Sub fillcmb_TBL_Classroom()
If FormMin.ListBoxClas.SelectedItem IsNot Nothing Then
Me.Combroom.Items.Clear()
Dim Sql_Str As String = "SELECT DISTINCT Classroom From TBL_SClassroom Where ClassName = '" & FormMin.ListBoxClas.Text() & "'"
Dim InfoAdapter As OleDbDataAdapter = New OleDbDataAdapter(Sql_Str, Con)
Dim InfoTable As DataSet = New DataSet
InfoTable.Clear()
InfoAdapter.Fill(InfoTable, "TBL_SClassroom")
For Each rw As DataRow In InfoTable.Tables("TBL_SClassroom").Rows
Me.Combroom.Items.Add(rw(0).ToString())
Next
Else
MessageBox.Show(" عفواً ، يجب اختيـار فصـل دراســي", "تنبيــه", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign)
End If
End Sub
إذا طُعِنتَ من الخلفِ فاعلمْ أنك في المقدمةِ

