الاخوة الزملاء
احب ان اشكر كل الزملاء بالمنتدى على مجهودهم الذى استفدت منه
وان شاء الله ساستعين فى الشرح القادم بمجهودهم مع بعض التعديلات
وذلك لشرح الطرق المتعددة للفورم للاستفادة منها
فورم بحث وتعديل واضافة بيانات الدرس الثامن
نتعرف على ComboBox
البحث برفم الجلوس
Private Sub ComboBox1_Change()
Set sh12 = Sheets("بيانات")
Lr = sh12.[a2000].End(xlUp).Row
For Each CL In sh12.Range("a5:b" & Lr)
If (Val(Me.ComboBox1)) = CL Then
Me.TextBox1 = CL.Offset(0, 0)
Me.TextBox2 = CL.Offset(0, 1)
Me.TextBox3 = CL.Offset(0, 2)
Me.TextBox4 = CL.Offset(0, 3)
Me.TextBox5 = CL.Offset(0, 4)
Me.TextBox6 = CL.Offset(0, 5)
Me.TextBox7 = CL.Offset(0, 6)
Me.TextBox8 = CL.Offset(0, 7)
Me.TextBox9 = CL.Offset(0, 8)
Me.TextBox10 = CL.Offset(0, 9)
Me.TextBox11 = CL.Offset(0, 10)
End If
Next
End Sub
البحث برقم الجلوس مع اظهار عمودين الرقم والاسماء
Private Sub ComboBox2_Change()
Set sh12 = Sheets("بيانات")
Lr = sh12.[a2000].End(xlUp).Row
For Each CL In sh12.Range("a5:c" & Lr)
If (Val(Me.ComboBox2)) = CL Then
Me.TextBox2 = CL.Offset(0, 1)
Me.TextBox1 = CL.Offset(0, 0)
Me.TextBox3 = CL.Offset(0, 2)
Me.TextBox4 = CL.Offset(0, 3)
Me.TextBox5 = CL.Offset(0, 4)
Me.TextBox6 = CL.Offset(0, 5)
Me.TextBox7 = CL.Offset(0, 6)
Me.TextBox8 = CL.Offset(0, 7)
Me.TextBox9 = CL.Offset(0, 8)
Me.TextBox10 = CL.Offset(0, 9)
Me.TextBox11 = CL.Offset(0, 10)
End If
Next
End Sub