24-01-23, 08:50 AM
(24-01-23, 02:54 AM)Taha Okla كتب :جزيل الشكركود :
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
DataGridView1.DataSource = Nothing
Dim t As String = ComboBox1.Text
If t = "JUL" Then t = "July" ' بسبب عدم تطابق اسم هذا الشهر ' ??!!! Fear Allah, man
dt = New DataTable
If ComboBox1.SelectedIndex <= 12 Then
If ComboBox2.Text.Trim() = "" Then
MsgBox("يرجى ادخال رقم الموظف.", vbExclamation, "تنبيه")
ComboBox2.Focus()
Exit Sub
End If
da = New OleDbDataAdapter("SELECT * FROM [" & t & "] WHERE [PF] = @c ", con)
da.SelectCommand.Parameters.AddWithValue("@c", ComboBox2.Text.Trim)
Else
ComboBox2.Text = ""
da = New OleDbDataAdapter("SELECT * FROM [" & t & "] ", con)
End If
da.Fill(dt)
DataGridView1.DataSource = dt
DataGridView1.ClearSelection()
End
اللهمّ بعلمك الغيب وقدرتك على الخلق، أحييني ما علمت الحياة خيراً لي، وتوفّني ما علمت الوفاة خيراً لي.

