code ที่ใช้
Code: Select all
Private Sub CommandButton2_Click()
'»ØèÁ Update
If Me.cmbslno.Value = "" Then
MsgBox "ID No Can Not be Blank!!!", vbExclamation, "SL No"
Exit Sub
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
i = 0
Do While Not IsEmpty(Sheet15.Cells(4 + i, 1).Value)
If Sheet15.Cells(4 + i, 1).Value = cmbslno.Text Then
Sheet15.Cells(4 + i, 8).Value = Noname.Text & " " & Textname.Text
Sheet15.Cells(4 + i, 9).Value = TextBox01.Text
Sheet15.Cells(4 + i, 10).Value = TextBox02.Text
Sheet15.Cells(4 + i, 11).Value = TextBox03.Text
Sheet15.Cells(4 + i, 15).Value = TextBox11.Text
Sheet15.Cells(4 + i, 16).Value = TextBox12.Text
Sheet15.Cells(4 + i, 17).Value = TextBox13.Text
Sheet15.Cells(4 + i, 22).Value = ComboBox21.Text
Sheet15.Cells(4 + i, 23).Value = ComboBox22.Text
Sheet15.Cells(4 + i, 24).Value = ComboBox23.Text
MsgBox "¨Ñ´à¡çºÅ§ã¹°Ò¹¢éÍÁÙÅàÃÕºÃéÍÂáÅéÇ"
Exit Do
End If
i = i + 1
Loop
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim j, already As Integer
ListBox01.Clear
j = 0
Do While Not IsEmpty(Sheet15.Cells(4 + j, 8).Value)
already = 0
If Sheet15.Cells(4 + j, 3).Value = ComboBox02.Value Then
If Sheet15.Cells(4 + j, 2).Value = ComboBox01.Value Then
ListBox01.AddItem Sheet15.Cells(4 + j, 8).Value
End If
End If
j = j + 1
Loop
Call Blank
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ComboBox21.Clear
ComboBox22.Clear
ComboBox23.Clear
Call open_comboBox2
End Sub
code ที่ทำงานให้ใส่ในช่อง
Code: Select all
Dim i As Integer
i = 0
Do While Not IsEmpty(Sheet15.Cells(4 + i, 1).Value)
If Sheet15.Cells(4 + i, 1).Value = cmbslno.Text Then
Sheet15.Cells(4 + i, 8).Value = Noname.Text & " " & Textname.Text
Sheet15.Cells(4 + i, 9).Value = TextBox01.Text
Sheet15.Cells(4 + i, 10).Value = TextBox02.Text
Sheet15.Cells(4 + i, 11).Value = TextBox03.Text
Sheet15.Cells(4 + i, 15).Value = TextBox11.Text
Sheet15.Cells(4 + i, 16).Value = TextBox12.Text
Sheet15.Cells(4 + i, 17).Value = TextBox13.Text
Sheet15.Cells(4 + i, 22).Value = ComboBox21.Text
Sheet15.Cells(4 + i, 23).Value = ComboBox22.Text
Sheet15.Cells(4 + i, 24).Value = ComboBox23.Text
MsgBox "¨Ñ´à¡çºÅ§ã¹°Ò¹¢éÍÁÙÅàÃÕºÃéÍÂáÅéÇ"
Exit Do
End If
i = i + 1
Loop
ผมไม่เข้าว่าจะทำอย่างไรให้ textbox รู้ว่าควรใส่ตาม พศ.ครับ